package caisar-ir

  1. Overview
  2. Docs
type shape = Base.int Base.array
type operator =
  1. | Add
  2. | Sub
  3. | Mul
  4. | Div
  5. | Matmul
  6. | Gemm
  7. | LogSoftmax
  8. | ReLu
  9. | Transpose
  10. | Squeeze
  11. | MaxPool
  12. | Conv
  13. | Reshape
  14. | Flatten
  15. | Identity
  16. | Constant
  17. | NO_OP
  18. | RW_Linearized_ReLu

Type describing the different operations handled. Those operations are inspired by those defined in the ONNX documentation.

val str_op : operator -> Base.string
val show_shape : shape -> Base.string
type ksize =
  1. | Ksize of shape
type stride =
  1. | Stride of shape
type pads =
  1. | Pads of shape
type dilations =
  1. | Dilations of shape
type operator_parameters =
  1. | Pool_params of ksize * stride Base.option * pads Base.option * dilations Base.option
  2. | Conv_params of ksize * stride Base.option * pads Base.option * dilations Base.option
  3. | Transpose_params of shape
  4. | RW_Linearized_ReLu_params of Base.bool Base.list Base.list * ((Base.string, Base.float) Base.Hashtbl.t Base.list * Base.int)
val str_op_params : operator_parameters -> Base.string
type ('a, 'b) t = {
  1. id : Base.int;
  2. name : Base.string Base.option;
  3. shape : shape;
  4. operator : operator;
  5. operator_parameters : operator_parameters Base.option;
  6. pred : Base.string Base.list;
  7. succ : Base.string Base.list;
  8. tensor : ('a, 'b) Tensor.t Base.option;
}

Type encapsulating parameters for operations. For Convolutions and Pooling, kernel size, padding, strides For Transpose, shape

val compare : ('a, 'b) t -> ('a, 'b) t -> Base.int
val hash : ('a, 'b) t -> Base.int
val equal : ('a, 'b) t -> ('a, 'b) t -> Base.bool
val create : id:Base.int -> name:Base.string Base.option -> sh:shape -> op:operator -> op_p:operator_parameters Base.option -> pred:Base.string Base.list -> succ:Base.string Base.list -> tensor:('a, 'b) Tensor.t Base.option -> ('a, 'b) t
val get_name : ('a, 'b) t -> Base.string
val get_shape : ('a, 'b) t -> shape
val get_op : ('a, 'b) t -> operator
val get_pred_list : ('a, 'b) t -> Base.string Base.list
val get_succ_list : ('a, 'b) t -> Base.string Base.list
val get_tensor : ('a, 'b) t -> ('a, 'b) Tensor.t Base.option
val is_data_node : ('a, 'b) t -> Base.bool
val is_input_node : ('a, 'b) t -> Base.bool
val is_output_node : ('a, 'b) t -> Base.bool
val num_neurons : ('a, 'b) t -> Base.int
val show : ('a, 'b) t -> ('a -> Base.string) -> Base.string
OCaml

Innovation. Community. Security.