1syntax = "proto3"; 2 3package tensorflow.serving; 4 5// Signatures of model export. 6message Signatures { 7 // Default signature of the graph. 8 // WARNING(break-tutorial-inline-code): The following code snippet is 9 // in-lined in tutorials, please update tutorial documents accordingly 10 // whenever code changes. 11 Signature default_signature = 1; 12 13 // Named signatures of the graph. 14 map<string, Signature> named_signatures = 2; 15}; 16 17// A binding to a tensor including the name and, possibly in the future, type 18// or other metadata. For example, this may specify whether a tensor supports 19// batch vs single inference. 20message TensorBinding { 21 // The name of the tensor to bind to. 22 string tensor_name = 1; 23}; 24 25// An asset file or set of sharded files with the same name that will be bound 26// to a tensor at init / session_bundle load time. 27message AssetFile { 28 // The tensor to bind the asset filename to. 29 TensorBinding tensor_binding = 1; 30 // The filename within the assets directory. Note: does not include the base 31 // path or asset directory prefix. Base paths can and will change when models 32 // are deployed for serving. 33 string filename = 2; 34} 35 36// A Signature specifies the inputs and outputs of commonly used graphs. 37message Signature { 38 oneof type { 39 RegressionSignature regression_signature = 1; 40 ClassificationSignature classification_signature = 2; 41 GenericSignature generic_signature = 3; 42 } 43}; 44 45// RegressionSignature specifies a graph that takes an input and returns an 46// output. 47message RegressionSignature { 48 TensorBinding input = 1; 49 TensorBinding output = 2; 50}; 51 52// ClassificationSignature specifies a graph that takes an input and returns 53// classes and their scores. 54// WARNING(break-tutorial-inline-code): The following code snippet is 55// in-lined in tutorials, please update tutorial documents accordingly 56// whenever code changes. 57message ClassificationSignature { 58 TensorBinding input = 1; 59 TensorBinding classes = 2; 60 TensorBinding scores = 3; 61}; 62 63// GenericSignature specifies a map from logical name to Tensor name. 64// Typical application of GenericSignature is to use a single GenericSignature 65// that includes all of the Tensor nodes and target names that may be useful at 66// serving, analysis or debugging time. The recommended name for this signature 67// in the ModelManifest is "generic_bindings". 68message GenericSignature { 69 map<string, TensorBinding> map = 1; 70}; 71