package caisar
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.
val pp_ty :
Ppx_deriving_runtime.Format.formatter ->
ty ->
Ppx_deriving_runtime.unit
val show_ty : ty -> Ppx_deriving_runtime.string
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;
}
val pp_descr :
Ppx_deriving_runtime.Format.formatter ->
descr ->
Ppx_deriving_runtime.unit
val show_descr : descr -> Ppx_deriving_runtime.string
val pp :
Ppx_deriving_runtime.Format.formatter ->
t ->
Ppx_deriving_runtime.unit
val show : t -> Ppx_deriving_runtime.string
include Base.Hashtbl.Key.S with type t := t
val sexp_of_t : t -> Sexplib0.Sexp.t
val hash : t -> int
Two t
s that compare
equal must have equal hashes for the hashtable to behave properly.
include Base.Comparator.S with type t := t
val comparator : (t, comparator_witness) Base.Comparator.comparator
create descr
returns a value of type node with proper indexing and the shape according to the ONNX semantic.
Iterate on the predecessors of a t and itself. Repect topological order.
val mul_float : t -> Base.float -> t
val div_float : ?encode:Base.bool -> t -> Base.float -> t