Documentation ¶
Index ¶
- Variables
- func RegisterPredictionServiceServer(s grpc.ServiceRegistrar, srv PredictionServiceServer)
- type ModelSpec
- func (*ModelSpec) Descriptor() ([]byte, []int)deprecated
- func (x *ModelSpec) GetName() string
- func (x *ModelSpec) GetSignatureName() string
- func (x *ModelSpec) GetVersion() *wrapperspb.Int64Value
- func (m *ModelSpec) GetVersionChoice() isModelSpec_VersionChoice
- func (x *ModelSpec) GetVersionLabel() string
- func (*ModelSpec) ProtoMessage()
- func (x *ModelSpec) ProtoReflect() protoreflect.Message
- func (x *ModelSpec) Reset()
- func (x *ModelSpec) String() string
- type ModelSpec_Version
- type ModelSpec_VersionLabel
- type PredictRequest
- func (*PredictRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PredictRequest) GetInputs() map[string]*framework.TensorProto
- func (x *PredictRequest) GetModelSpec() *ModelSpec
- func (x *PredictRequest) GetOutputFilter() []string
- func (*PredictRequest) ProtoMessage()
- func (x *PredictRequest) ProtoReflect() protoreflect.Message
- func (x *PredictRequest) Reset()
- func (x *PredictRequest) String() string
- type PredictResponse
- func (*PredictResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PredictResponse) GetModelSpec() *ModelSpec
- func (x *PredictResponse) GetOutputs() map[string]*framework.TensorProto
- func (*PredictResponse) ProtoMessage()
- func (x *PredictResponse) ProtoReflect() protoreflect.Message
- func (x *PredictResponse) Reset()
- func (x *PredictResponse) String() string
- type PredictionServiceClient
- type PredictionServiceServer
- type UnimplementedPredictionServiceServer
- type UnsafePredictionServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_tensorflow_serving_apis_model_proto protoreflect.FileDescriptor
var File_tensorflow_serving_apis_predict_proto protoreflect.FileDescriptor
var File_tensorflow_serving_apis_prediction_service_proto protoreflect.FileDescriptor
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 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) GetSignatureName ¶
func (*ModelSpec) GetVersion ¶
func (x *ModelSpec) GetVersion() *wrapperspb.Int64Value
func (*ModelSpec) GetVersionChoice ¶
func (m *ModelSpec) GetVersionChoice() isModelSpec_VersionChoice
func (*ModelSpec) GetVersionLabel ¶
func (*ModelSpec) ProtoMessage ¶
func (*ModelSpec) ProtoMessage()
func (*ModelSpec) ProtoReflect ¶
func (x *ModelSpec) ProtoReflect() protoreflect.Message
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.
func NewPredictionServiceClient ¶
func NewPredictionServiceClient(cc grpc.ClientConnInterface) PredictionServiceClient
type PredictionServiceServer ¶
type PredictionServiceServer interface { // Predict -- provides access to loaded TensorFlow model. Predict(context.Context, *PredictRequest) (*PredictResponse, error) }
PredictionServiceServer is the server API for PredictionService service. All implementations should embed UnimplementedPredictionServiceServer for forward compatibility
type UnimplementedPredictionServiceServer ¶
type UnimplementedPredictionServiceServer struct { }
UnimplementedPredictionServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedPredictionServiceServer) Predict ¶
func (UnimplementedPredictionServiceServer) Predict(context.Context, *PredictRequest) (*PredictResponse, error)
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.