Principle:Tensorflow Serving Signature Definition
| Knowledge Sources | |
|---|---|
| Domains | Model_Serialization, API_Design |
| Last Updated | 2026-02-13 17:00 GMT |
Overview
A protocol for declaring the input and output tensor interface of a served model, enabling clients to invoke inference without knowledge of internal graph structure.
Description
Signature Definitions (SignatureDefs) are protobuf messages that define the contract between a TensorFlow Serving client and a served model. Each SignatureDef specifies named inputs (mapping alias names to tensor info), named outputs, and a method name indicating the type of inference (Classify, Regress, or Predict).
SignatureDefs solve the problem of graph-level coupling: without them, clients would need to know internal tensor names. By providing an abstraction layer, SignatureDefs enable model versioning and graph restructuring without breaking client contracts.
A model can have multiple SignatureDefs. One is designated as the default serving signature (used when clients do not specify a signature name). Additional named signatures can serve different inference patterns on the same model.
Usage
Use SignatureDefs whenever exporting a TensorFlow model for serving. Every SavedModel must have at least one SignatureDef to be usable with TensorFlow Serving. Define a classification signature for classify requests, a prediction signature for predict requests, or both.
Theoretical Basis
A SignatureDef is a protobuf with three fields:
# Abstract structure (NOT real implementation)
SignatureDef:
inputs: map<string, TensorInfo> # Named input tensors
outputs: map<string, TensorInfo> # Named output tensors
method_name: string # CLASSIFY, PREDICT, or REGRESS
TensorInfo binds an alias name to a concrete tensor in the graph:
- name: The tensor's graph name (e.g., "x:0")
- dtype: Data type (e.g., DT_FLOAT)
- tensor_shape: Shape information
Method Names determine which API endpoint serves this signature:
- tensorflow/serving/classify → Classification API
- tensorflow/serving/predict → Prediction API
- tensorflow/serving/regress → Regression API