Skip to content

Commit 3e6382b

Browse files
authored
Update documentation about required input output types (#2310)
1 parent 0c765d9 commit 3e6382b

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

docs/IR.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,17 @@ input|ValueInfo[]|The input “parameters” of the graph, possibly initialized
162162
output|ValueInfo[]|The output parameters of the graph. Once all output parameters have been written to by a graph execution, the execution is complete.
163163
value_info|ValueInfo[]|Used to store the type and shape information of values that are not inputs or outputs.
164164

165-
Each graph MUST define the names and types of its inputs and outputs, which are specified as ‘value info’ structures, having the following properties:
165+
Each main (top-level) graph MUST define the names and types of its inputs and outputs, which are specified as ‘value info’ structures, having the following properties:
166166

167167
Name|Type|Description
168168
|---|---|---|
169169
name|string|The name of the value/parameter.
170170
type|Type|The type of the value.
171171
doc_string|string|A human-readable documentation for this value. Markdown is allowed.
172172

173+
Nested subgraphs (specified as attribute values) MUST define the names of its inputs and outputs
174+
and MAY define the types of its inputs and outputs.
175+
173176
Each graph MUST specify a name.
174177

175178
The graph MUST adhere to single static assignment (SSA) for all node outputs; this means that all node output names MUST be unique within a graph.
@@ -265,9 +268,9 @@ The properties ‘name’ and ‘type’ are required on all attributes, and ‘
265268

266269
#### Variadic Inputs and Outputs
267270

268-
The last input or output of an operator MAY be marked as variadic. For example, the operator 'Max()' can be used to compute the maximum of a varying number of input values.
271+
The last input or output of an operator MAY be marked as variadic. For example, the operator 'Max()' can be used to compute the maximum of a varying number of input values. A variadic operator has an associated minimum arity, which specifies the minimum number of operands that must be specified.
269272

270-
For each variadic operator input, one or more node inputs must be specified. For each variadic operator output, one or more node outputs must be specified.
273+
For each variadic operator input, N or more node inputs must be specified where N is the minimum arity of the operator. For each variadic operator output, N or more node outputs must be specified where N is the minimum arity of the operator.
271274

272275
#### Optional Inputs and Outputs
273276

onnx/onnx-ml.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ message AttributeProto {
165165
message ValueInfoProto {
166166
// This field MUST be present in this version of the IR.
167167
optional string name = 1; // namespace Value
168-
// This field MUST be present in this version of the IR.
168+
// This field MUST be present in this version of the IR for
169+
// inputs and outputs of the top-level graph.
169170
optional TypeProto type = 2;
170171
// A human-readable documentation for this value. Markdown is allowed.
171172
optional string doc_string = 3;

onnx/onnx-ml.proto3

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ message AttributeProto {
165165
message ValueInfoProto {
166166
// This field MUST be present in this version of the IR.
167167
string name = 1; // namespace Value
168-
// This field MUST be present in this version of the IR.
168+
// This field MUST be present in this version of the IR for
169+
// inputs and outputs of the top-level graph.
169170
TypeProto type = 2;
170171
// A human-readable documentation for this value. Markdown is allowed.
171172
string doc_string = 3;

onnx/onnx.in.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ message AttributeProto {
162162
message ValueInfoProto {
163163
// This field MUST be present in this version of the IR.
164164
optional string name = 1; // namespace Value
165-
// This field MUST be present in this version of the IR.
165+
// This field MUST be present in this version of the IR for
166+
// inputs and outputs of the top-level graph.
166167
optional TypeProto type = 2;
167168
// A human-readable documentation for this value. Markdown is allowed.
168169
optional string doc_string = 3;

onnx/onnx.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ message AttributeProto {
163163
message ValueInfoProto {
164164
// This field MUST be present in this version of the IR.
165165
optional string name = 1; // namespace Value
166-
// This field MUST be present in this version of the IR.
166+
// This field MUST be present in this version of the IR for
167+
// inputs and outputs of the top-level graph.
167168
optional TypeProto type = 2;
168169
// A human-readable documentation for this value. Markdown is allowed.
169170
optional string doc_string = 3;

onnx/onnx.proto3

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ message AttributeProto {
163163
message ValueInfoProto {
164164
// This field MUST be present in this version of the IR.
165165
string name = 1; // namespace Value
166-
// This field MUST be present in this version of the IR.
166+
// This field MUST be present in this version of the IR for
167+
// inputs and outputs of the top-level graph.
167168
TypeProto type = 2;
168169
// A human-readable documentation for this value. Markdown is allowed.
169170
string doc_string = 3;

0 commit comments

Comments
 (0)