Nir.NodeSourceA node is composed of
id of type intdescrdescr describes several operations. When an operation shares the same name as an ONNX operation, it follows the standard defined in the ONNX IR v8 and ONNX Opset v13 standards, described here: https://onnx.ai/onnx/operators/index.html.
Nodes only require their inputs: it is assumed that a node only returns one value.
type descr = | Constant of {data : Gentensor.t;}A constant tensor, used to store non-varying parameters during inference.
*)| Add of {}| Sub of {}| Mul of {}| Div of {}| Matmul of {}| Gemm of {inputA : t;inputB : t;inputC : t Base.option;alpha : Base.float;beta : Base.float;transA : Base.int;transB : Base.int;}| LogSoftmax| ReLu of {input : t;}| Transpose of {input : t;Called "data" in ONNX documentation : https://onnx.ai/onnx/operators/onnx__Transpose.html .
*)perm : Base.int Base.list;}| Squeeze of {data : t;axes : t Base.option;}| MaxPool| Conv| Reshape of {}| Flatten of {}| Identity of {input : t;}| Input of {shape : Shape.t;}| RW_Linearized_ReLu| Concat of {}| Gather of {}| ReduceSum of {input : t;axes : t Base.option;keepdims : Base.int;noop_with_empty_axes : Base.int;}| GatherND of {}| RandomNormal of {dtype : Base.int;mean : Base.float;scale : Base.float;seed : Base.float;shape : Base.int Base.array;}| Abs of {input : t;}| Log of {input : t;}create descr returns a value of type node with proper indexing and the shape according to the ONNX semantic.
map_rec f n replace top-bottom the nodes i accessible from n by f i
replace_input f n replace the input in n by f ()
Iterate on the predecessors of a t and itself. Repect topological order.