You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/IR.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,6 +171,41 @@ The ‘status’ property indicates whether the syntax, semantics, or presence o
171
171
172
172
There are two distinct ways to pass information to operators – inputs and attributes. Inputs represent graph inputs or values computed elsewhere in the graph, while attributes are used for values that are constants in the graph. This distinction may be highly relevant to achieving good performance for some implementations, while completely irrelevant to others.
173
173
174
+
### Functions
175
+
176
+
A _function_ may be thought of as an operator combined with an implementation of the operator using
177
+
other, more primitive, ops, referred to as the _function body_. The function body consists of a
178
+
topologically sorted list of nodes that form a graph. Thus, a function combines aspects of both
179
+
an operator as well a graph (described below).
180
+
181
+
Each function contained in a Model (also referred to as a model-local function) serves
182
+
as a default or fallback implementation of the corresponding operator. A runtime, however,
183
+
may choose to use an alternative implementation of the operator (usually as an optimized kernel).
184
+
As such, the unique name of a function is significant as it is implicitly associated with a
185
+
semantic specification.
186
+
187
+
A serialized function (a _FunctionProto_) has the following properties:
188
+
189
+
|Name|Type|Description|
190
+
|---|---|---|
191
+
name|string|The name of the function
192
+
domain|string|The domain to which this function belongs
193
+
doc_string|string|Human-readable documentation for this function. Markdown is allowed.
194
+
attribute|string[]|The attribute parameters of the function
195
+
input|string[]|The input parameters of the function
196
+
output|string[]|The output parameters of the function.
197
+
node|Node[]|A list of nodes, forming a partially ordered computation graph. It must be in topological order.
198
+
|opset_import|OperatorSetId|A collection of operator set identifiers used by the function implementation.
199
+
200
+
The name and domain serve to identify the operator uniquely. An opset version is not explicitly
201
+
identified in a FunctionProto, but it is implicitly determined by the opset version of the domain
202
+
included in the model.
203
+
204
+
The input, output, and attribute constitute the signature part of the operator. No type information
205
+
is explicitly included in the signature.
206
+
207
+
The opset_import and node fields describe the implementation of the function.
208
+
174
209
### Graphs
175
210
176
211
A graph is used to describe a side-effect-free computation (function).
0 commit comments