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.

Containment relations between ONNX protos

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: