apis

package
v2.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_tensorflow_serving_apis_input_proto protoreflect.FileDescriptor
View Source
var File_tensorflow_serving_apis_model_proto protoreflect.FileDescriptor
View Source
var File_tensorflow_serving_apis_predict_proto protoreflect.FileDescriptor
View Source
var File_tensorflow_serving_apis_prediction_service_proto protoreflect.FileDescriptor
View Source
var PredictionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tensorflow.serving.PredictionService",
	HandlerType: (*PredictionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Predict",
			Handler:    _PredictionService_Predict_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "tensorflow_serving/apis/prediction_service.proto",
}

PredictionService_ServiceDesc is the grpc.ServiceDesc for PredictionService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterPredictionServiceServer

func RegisterPredictionServiceServer(s grpc.ServiceRegistrar, srv PredictionServiceServer)

Types

type ExampleList

type ExampleList struct {
	Examples []*example.Example `protobuf:"bytes,1,rep,name=examples,proto3" json:"examples,omitempty"`
	// contains filtered or unexported fields
}

Specifies one or more fully independent input Examples. See examples at:

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/example/example.proto

func (*ExampleList) Descriptor deprecated

func (*ExampleList) Descriptor() ([]byte, []int)

Deprecated: Use ExampleList.ProtoReflect.Descriptor instead.

func (*ExampleList) GetExamples

func (x *ExampleList) GetExamples() []*example.Example

func (*ExampleList) ProtoMessage

func (*ExampleList) ProtoMessage()

func (*ExampleList) ProtoReflect

func (x *ExampleList) ProtoReflect() protoreflect.Message

func (*ExampleList) Reset

func (x *ExampleList) Reset()

func (*ExampleList) String

func (x *ExampleList) String() string

type ExampleListWithContext

type ExampleListWithContext struct {
	Examples []*example.Example `protobuf:"bytes,1,rep,name=examples,proto3" json:"examples,omitempty"`
	Context  *example.Example   `protobuf:"bytes,2,opt,name=context,proto3" json:"context,omitempty"`
	// contains filtered or unexported fields
}

Specifies one or more independent input Examples, with a common context Example.

The common use case for context is to cleanly and optimally specify some features that are common across multiple examples.

See example below with a search query as the context and multiple restaurants to perform some inference on.

context: {
  feature: {
    key  : "query"
    value: {
      bytes_list: {
        value: [ "pizza" ]
      }
    }
  }
}

examples: {
  feature: {
    key  : "cuisine"
    value: {
      bytes_list: {
        value: [ "Pizzeria" ]
      }
    }
  }
}

examples: {
  feature: {
    key  : "cuisine"
    value: {
      bytes_list: {
        value: [ "Taqueria" ]
      }
    }
  }
}

Implementations of ExampleListWithContext merge the context Example into each of the Examples. Note that feature keys must not be duplicated between the Examples and context Example, or the behavior is undefined.

See also:

tensorflow/core/example/example.proto
https://developers.google.com/protocol-buffers/docs/proto3#maps

func (*ExampleListWithContext) Descriptor deprecated

func (*ExampleListWithContext) Descriptor() ([]byte, []int)

Deprecated: Use ExampleListWithContext.ProtoReflect.Descriptor instead.

func (*ExampleListWithContext) GetContext

func (x *ExampleListWithContext) GetContext() *example.Example

func (*ExampleListWithContext) GetExamples

func (x *ExampleListWithContext) GetExamples() []*example.Example

func (*ExampleListWithContext) ProtoMessage

func (*ExampleListWithContext) ProtoMessage()

func (*ExampleListWithContext) ProtoReflect

func (x *ExampleListWithContext) ProtoReflect() protoreflect.Message

func (*ExampleListWithContext) Reset

func (x *ExampleListWithContext) Reset()

func (*ExampleListWithContext) String

func (x *ExampleListWithContext) String() string

type Input

type Input struct {

	// Types that are assignable to Kind:
	//
	//	*Input_ExampleList
	//	*Input_ExampleListWithContext
	Kind isInput_Kind `protobuf_oneof:"kind"`
	// contains filtered or unexported fields
}

func (*Input) Descriptor deprecated

func (*Input) Descriptor() ([]byte, []int)

Deprecated: Use Input.ProtoReflect.Descriptor instead.

func (*Input) GetExampleList

func (x *Input) GetExampleList() *ExampleList

func (*Input) GetExampleListWithContext

func (x *Input) GetExampleListWithContext() *ExampleListWithContext

func (*Input) GetKind

func (m *Input) GetKind() isInput_Kind

func (*Input) ProtoMessage

func (*Input) ProtoMessage()

func (*Input) ProtoReflect

func (x *Input) ProtoReflect() protoreflect.Message

func (*Input) Reset

func (x *Input) Reset()

func (*Input) String

func (x *Input) String() string

type Input_ExampleList

type Input_ExampleList struct {
	ExampleList *ExampleList `protobuf:"bytes,1,opt,name=example_list,json=exampleList,proto3,oneof"`
}

type Input_ExampleListWithContext

type Input_ExampleListWithContext struct {
	ExampleListWithContext *ExampleListWithContext `protobuf:"bytes,2,opt,name=example_list_with_context,json=exampleListWithContext,proto3,oneof"`
}

type ModelSpec

type ModelSpec struct {

	// Required servable name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Optional choice of which version of the model to use.
	//
	// Recommended to be left unset in the common case. Should be specified only
	// when there is a strong version consistency requirement.
	//
	// When left unspecified, the system will serve the best available version.
	// This is typically the latest version, though during version transitions,
	// notably when serving on a fleet of instances, may be either the previous or
	// new version.
	//
	// Types that are assignable to VersionChoice:
	//
	//	*ModelSpec_Version
	//	*ModelSpec_VersionLabel
	VersionChoice isModelSpec_VersionChoice `protobuf_oneof:"version_choice"`
	// A named signature to evaluate. If unspecified, the default signature will
	// be used.
	SignatureName string `protobuf:"bytes,3,opt,name=signature_name,json=signatureName,proto3" json:"signature_name,omitempty"`
	// contains filtered or unexported fields
}

Metadata for an inference request such as the model name and version.

func (*ModelSpec) Descriptor deprecated

func (*ModelSpec) Descriptor() ([]byte, []int)

Deprecated: Use ModelSpec.ProtoReflect.Descriptor instead.

func (*ModelSpec) GetName

func (x *ModelSpec) GetName() string

func (*ModelSpec) GetSignatureName

func (x *ModelSpec) GetSignatureName() string

func (*ModelSpec) GetVersion

func (x *ModelSpec) GetVersion() *wrapperspb.Int64Value

func (*ModelSpec) GetVersionChoice

func (m *ModelSpec) GetVersionChoice() isModelSpec_VersionChoice

func (*ModelSpec) GetVersionLabel

func (x *ModelSpec) GetVersionLabel() string

func (*ModelSpec) ProtoMessage

func (*ModelSpec) ProtoMessage()

func (*ModelSpec) ProtoReflect

func (x *ModelSpec) ProtoReflect() protoreflect.Message

func (*ModelSpec) Reset

func (x *ModelSpec) Reset()

func (*ModelSpec) String

func (x *ModelSpec) String() string

type ModelSpec_Version

type ModelSpec_Version struct {
	// Use this specific version number.
	Version *wrapperspb.Int64Value `protobuf:"bytes,2,opt,name=version,proto3,oneof"`
}

type ModelSpec_VersionLabel

type ModelSpec_VersionLabel struct {
	// Use the version associated with the given label.
	VersionLabel string `protobuf:"bytes,4,opt,name=version_label,json=versionLabel,proto3,oneof"`
}

type PredictRequest

type PredictRequest struct {

	// Model Specification. If version is not specified, will use the latest
	// (numerical) version.
	ModelSpec *ModelSpec `protobuf:"bytes,1,opt,name=model_spec,json=modelSpec,proto3" json:"model_spec,omitempty"`
	// Input tensors.
	// Names of input tensor are alias names. The mapping from aliases to real
	// input tensor names is stored in the SavedModel export as a prediction
	// SignatureDef under the 'inputs' field.
	Inputs map[string]*framework.TensorProto `` /* 153-byte string literal not displayed */
	// Output filter.
	// Names specified are alias names. The mapping from aliases to real output
	// tensor names is stored in the SavedModel export as a prediction
	// SignatureDef under the 'outputs' field.
	// Only tensors specified here will be run/fetched and returned, with the
	// exception that when none is specified, all tensors specified in the
	// named signature will be run/fetched and returned.
	OutputFilter []string `protobuf:"bytes,3,rep,name=output_filter,json=outputFilter,proto3" json:"output_filter,omitempty"`
	// contains filtered or unexported fields
}

PredictRequest specifies which TensorFlow model to run, as well as how inputs are mapped to tensors and how outputs are filtered before returning to user.

func (*PredictRequest) Descriptor deprecated

func (*PredictRequest) Descriptor() ([]byte, []int)

Deprecated: Use PredictRequest.ProtoReflect.Descriptor instead.

func (*PredictRequest) GetInputs

func (x *PredictRequest) GetInputs() map[string]*framework.TensorProto

func (*PredictRequest) GetModelSpec

func (x *PredictRequest) GetModelSpec() *ModelSpec

func (*PredictRequest) GetOutputFilter

func (x *PredictRequest) GetOutputFilter() []string

func (*PredictRequest) ProtoMessage

func (*PredictRequest) ProtoMessage()

func (*PredictRequest) ProtoReflect

func (x *PredictRequest) ProtoReflect() protoreflect.Message

func (*PredictRequest) Reset

func (x *PredictRequest) Reset()

func (*PredictRequest) String

func (x *PredictRequest) String() string

type PredictResponse

type PredictResponse struct {

	// Effective Model Specification used to process PredictRequest.
	ModelSpec *ModelSpec `protobuf:"bytes,2,opt,name=model_spec,json=modelSpec,proto3" json:"model_spec,omitempty"`
	// Output tensors.
	Outputs map[string]*framework.TensorProto `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

Response for PredictRequest on successful run.

func (*PredictResponse) Descriptor deprecated

func (*PredictResponse) Descriptor() ([]byte, []int)

Deprecated: Use PredictResponse.ProtoReflect.Descriptor instead.

func (*PredictResponse) GetModelSpec

func (x *PredictResponse) GetModelSpec() *ModelSpec

func (*PredictResponse) GetOutputs

func (x *PredictResponse) GetOutputs() map[string]*framework.TensorProto

func (*PredictResponse) ProtoMessage

func (*PredictResponse) ProtoMessage()

func (*PredictResponse) ProtoReflect

func (x *PredictResponse) ProtoReflect() protoreflect.Message

func (*PredictResponse) Reset

func (x *PredictResponse) Reset()

func (*PredictResponse) String

func (x *PredictResponse) String() string

type PredictionServiceClient

type PredictionServiceClient interface {
	// Predict -- provides access to loaded TensorFlow model.
	Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*PredictResponse, error)
}

PredictionServiceClient is the client API for PredictionService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type PredictionServiceServer

type PredictionServiceServer interface {
	// Predict -- provides access to loaded TensorFlow model.
	Predict(context.Context, *PredictRequest) (*PredictResponse, error)
	// contains filtered or unexported methods
}

PredictionServiceServer is the server API for PredictionService service. All implementations must embed UnimplementedPredictionServiceServer for forward compatibility

type UnimplementedPredictionServiceServer

type UnimplementedPredictionServiceServer struct {
}

UnimplementedPredictionServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPredictionServiceServer) Predict

type UnsafePredictionServiceServer

type UnsafePredictionServiceServer interface {
	// contains filtered or unexported methods
}

UnsafePredictionServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PredictionServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL