protos#
Relations between protos#
The following graph shows containment relations between ONNX protos.
Each edge label is the attribute name (or names) that carries the nested proto.
The SVG below is generated from
protos_relations.dot with
dot -Tsvg (Graphviz); regenerate it after editing the .dot source.
Click the diagram to open it in a full-screen view where the mouse wheel zooms and dragging pans, which makes the smaller labels easier to read.
ASCII tree#
The same containment relations as a text tree, rooted at
ModelProto. Edge labels are the attribute names; (↑) marks a proto
already expanded earlier in the tree (the graph contains cycles), and
configuration_id is a name reference rather than a nested message.
ModelProto
├── graph → GraphProto
│ ├── node → NodeProto
│ │ ├── attribute → AttributeProto
│ │ │ ├── t, tensors → TensorProto
│ │ │ ├── g, graphs → GraphProto (↑)
│ │ │ ├── sparse_tensor, sparse_tensors → SparseTensorProto
│ │ │ └── tp, type_protos → TypeProto
│ │ ├── device_configurations → NodeDeviceConfigurationProto
│ │ │ ├── sharding_spec → ShardingSpecProto
│ │ │ │ ├── index_to_device_group_map → IntIntListEntryProto
│ │ │ │ └── sharded_dim → ShardedDimProto
│ │ │ │ └── simple_sharding → SimpleShardedDimProto
│ │ │ └── configuration_id → DeviceConfigurationProto (name reference)
│ │ └── metadata_props → StringStringEntryProto
│ ├── initializer → TensorProto
│ │ ├── segment → Segment
│ │ └── external_data, metadata_props → StringStringEntryProto
│ ├── sparse_initializer → SparseTensorProto
│ │ └── values, indices → TensorProto
│ ├── input, output, value_info → ValueInfoProto
│ │ ├── type → TypeProto
│ │ │ ├── tensor_type → TypeProto.Tensor
│ │ │ │ └── shape → TensorShapeProto
│ │ │ │ └── dim → Dimension
│ │ │ ├── sparse_tensor_type → TypeProto.SparseTensor
│ │ │ │ └── shape → TensorShapeProto (↑)
│ │ │ ├── sequence_type → TypeProto.Sequence
│ │ │ │ └── elem_type → TypeProto (↑)
│ │ │ ├── map_type → TypeProto.Map
│ │ │ │ └── value_type → TypeProto (↑)
│ │ │ └── optional_type → TypeProto.Optional
│ │ │ └── elem_type → TypeProto (↑)
│ │ └── metadata_props → StringStringEntryProto
│ ├── quantization_annotation → TensorAnnotation
│ │ └── quant_parameter_tensor_names → StringStringEntryProto
│ └── metadata_props → StringStringEntryProto
├── opset_import → OperatorSetIdProto
├── functions → FunctionProto
│ ├── attribute_proto → AttributeProto (↑)
│ ├── node → NodeProto (↑)
│ ├── opset_import → OperatorSetIdProto
│ ├── value_info → ValueInfoProto (↑)
│ └── metadata_props → StringStringEntryProto
├── configuration → DeviceConfigurationProto
└── metadata_props → StringStringEntryProto
The runtime container protos form a separate cycle of their own:
SequenceProto
├── tensor_values → TensorProto
├── sparse_tensor_values → SparseTensorProto
├── sequence_values → SequenceProto (↑)
├── map_values → MapProto
│ └── values → SequenceProto (↑)
└── optional_values → OptionalProto
├── tensor_value → TensorProto
├── sparse_tensor_value → SparseTensorProto
├── sequence_value → SequenceProto (↑)
├── map_value → MapProto (↑)
└── optional_value → OptionalProto (↑)
Containment attributes#
Quick attribute list used in the graph:
ModelProto:
graph,opset_import,functions,configuration,metadata_propsGraphProto:
node,initializer,sparse_initializer,input,output,value_info,quantization_annotation,metadata_propsFunctionProto:
attribute_proto,node,opset_import,value_info,metadata_propsNodeProto:
attribute,device_configurations,metadata_propsNodeDeviceConfigurationProto:
sharding_spec(andconfiguration_id, a name reference to a DeviceConfigurationProto declared inModelProto.configuration)ShardingSpecProto:
index_to_device_group_map,sharded_dimShardedDimProto:
simple_shardingValueInfoProto:
type,metadata_propsTensorShapeProto:
dimTypeProto:
tensor_type(TypeProto.Tensor),sparse_tensor_type(TypeProto.SparseTensor),sequence_type(TypeProto.Sequence),map_type(TypeProto.Map),optional_type(TypeProto.Optional)TypeProto.Tensor / TypeProto.SparseTensor:
shape(a TensorShapeProto)TypeProto.Sequence / TypeProto.Optional:
elem_type(a TypeProto)TypeProto.Map:
value_type(a TypeProto)TensorProto:
segment,external_data,metadata_propsSparseTensorProto:
values,indicesAttributeProto:
t,tensors,g,graphs,sparse_tensor,sparse_tensors,tp,type_protosTensorAnnotation:
quant_parameter_tensor_namesSequenceProto:
tensor_values,sparse_tensor_values,sequence_values,map_values,optional_valuesMapProto:
valuesOptionalProto:
tensor_value,sparse_tensor_value,sequence_value,map_value,optional_value
- AttributeProto
- DeviceConfigurationProto
- FunctionProto
- GraphProto
- IntIntListEntryProto
- MapProto
- Message
- ModelProto
- NodeDeviceConfigurationProto
- NodeProto
- OperatorSetIdProto
- OperatorStatus
- OptionalProto
- SequenceProto
- ShardedDimProto
- ShardingSpecProto
- SimpleShardedDimProto
- SparseTensorProto
- StringStringEntryProto
- TensorAnnotation
- TensorProto
- TensorShapeProto
- TypeProto
- ValueInfoProto