package caisar
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=3d24d2940eed0921acba158a8970687743c401c6a99d0aac8ed6dcfedca1429c
sha512=0b4484c0e080b8ba22722fe9d5665f9015ebf1648ac89c566a978dd54e3e061acb63edd92e078eed310e26f3e8ad2c48f3682a24af2acb1f0633da12f7966a38
doc/caisar.nir/Nir/Node/index.html
Module Nir.Node
Source
Nodes descriptions
A node is composed of
- a unique
id
of type int - a node description of type
descr
descr
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.