tensorflow/tensorflow
Data models
The protobuf and on-disk formats this repo defines. Most are under tensorflow/core/framework/*.proto, tensorflow/core/protobuf/*.proto, and tensorflow/lite/schema/*.fbs.
Core types
Tensor
A tensor has a DataType, a TensorShape, and a TensorBuffer of bytes. Definition: tensorflow/core/framework/tensor.h. Wire format: tensorflow/core/framework/tensor.proto (TensorProto).
DataType enum: tensorflow/core/framework/types.proto. Notable values: DT_FLOAT, DT_DOUBLE, DT_INT8/16/32/64, DT_UINT8/16/32/64, DT_BOOL, DT_STRING, DT_BFLOAT16, DT_HALF, DT_VARIANT, DT_RESOURCE, plus the reference variants (DT_FLOAT_REF, …).
TensorShape
tensorflow/core/framework/tensor_shape.proto (TensorShapeProto). Optional unknown_rank, list of dim with optional name and size (where -1 denotes an unknown dimension).
OpDef
The schema of an op. tensorflow/core/framework/op_def.proto:
message OpDef {
string name = 1;
repeated ArgDef input_arg = 2;
repeated ArgDef output_arg = 3;
repeated AttrDef attr = 4;
...
}NodeDef, GraphDef
A NodeDef (tensorflow/core/framework/node_def.proto) is one node in a graph: name, op, inputs, attrs, device. A GraphDef is a list of NodeDefs plus versions (tensorflow/core/framework/graph.proto).
FunctionDef, FunctionDefLibrary
tensorflow/core/framework/function.proto. A function is a OpDef plus a list of node definitions and ret-name mappings. FunctionDefLibrary packages many functions.
MetaGraphDef, SavedModel
tensorflow/core/protobuf/meta_graph.proto and tensorflow/core/protobuf/saved_model.proto. The on-disk format for SavedModel; see features/saved-model for usage.
RunOptions, RunMetadata
tensorflow/core/protobuf/config.proto and tensorflow/core/protobuf/run_metadata.proto. Per-run configuration and tracing.
Configuration protos
| Proto | File | Purpose |
|---|---|---|
ConfigProto |
tensorflow/core/protobuf/config.proto |
Session-level configuration. |
GPUOptions |
tensorflow/core/protobuf/config.proto |
GPU-specific knobs. |
RewriterConfig |
tensorflow/core/protobuf/rewriter_config.proto |
Grappler optimizer toggles. |
ClusterDef / JobDef / TaskDef |
tensorflow/core/protobuf/cluster.proto |
Distributed cluster description. |
DebugOptions |
tensorflow/core/protobuf/debug.proto |
Tensor-level debugger options. |
Service definitions
gRPC service contracts:
| Proto | Service |
|---|---|
tensorflow/core/protobuf/master_service.proto |
Master |
tensorflow/core/protobuf/worker_service.proto |
Worker |
tensorflow/core/protobuf/eager_service.proto |
Remote eager |
tensorflow/core/distributed_runtime/coordination/coordination_service.proto |
Coordination service |
Examples and records
tensorflow/core/example/ holds the canonical training-record formats:
Example(example.proto) — a map of feature name →Feature(bytes_list/float_list/int64_list).SequenceExample— variable-length sequences of features.Feature,Features(feature.proto) — building blocks.
Disk format: each record is length-prefixed inside a TFRecord file (tensorflow/core/lib/io/record_*).
TFLite flatbuffer schema
tensorflow/lite/schema/schema.fbs — the entire .tflite file format. Key tables:
Model— root: version, operator codes, subgraphs, buffers, metadata.SubGraph— tensors, op codes, inputs, outputs.Operator— refers to an operator code and the input/output tensor indices.Buffer— raw bytes for constants.Tensor— name, shape, dtype, quantization parameters, sparsity.
Schema versioning is in tensorflow/lite/version.h. See apps/tensorflow-lite.
Auxiliary protos
A handful of useful ones to know:
Saver-related —tensorflow/core/protobuf/saver.proto,meta_graph.proto.- Profiler —
tensorflow/core/profiler/protobuf/xplane.proto(XSpace/XPlane/XStat). - Trackable graph —
tensorflow/core/protobuf/trackable_object_graph.proto.
Related
- features/saved-model — uses many of the above.
- systems/distributed-runtime — uses the gRPC service protos.
- apps/tensorflow-lite — uses
schema.fbs.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.