Owl_computation_symbol_sig.Sigmodule Shape : Owl_computation_shape_sig.Sigval op_to_str : Shape.Type.op -> stringreturn the name of the operator as string
val is_random_variable : Shape.Type.op -> boolcheck if operator is randon variable
val refnum : 'a Owl_graph.node -> intreturn the reference number of the given node
val node_shape : Shape.Type.attr Owl_graph.node -> int arrayreturn the shape of a node
val node_numel : Shape.Type.attr Owl_graph.node -> intreturn the number of elements of a node
val is_shape_unknown : Shape.Type.attr Owl_graph.node -> boolcheck if the shape of the input node is unknown
val infer_shape_graph : Shape.Type.attr Owl_graph.node array -> unitautomatically infer the shape of input node according to its descendents' shapes
helper function; return the input array in string format.
val node_to_str : Shape.Type.attr Owl_graph.node -> stringprint node's information to string
val node_to_arr : Shape.Type.t -> Shape.Type.arrWrap computation graph node in an array type
val arr_to_node : Shape.Type.arr -> Shape.Type.tUnwrap the array type to get the computation graph node within
val node_to_elt : Shape.Type.t -> Shape.Type.eltWrap computation graph node in an Elt type
val elt_to_node : Shape.Type.elt -> Shape.Type.tUnwrap the Elt type to get the computation graph node within
val make_node :
?name:string ->
?value:Shape.Type.Device.value array ->
?shape:int array option array ->
?freeze:bool ->
?reuse:bool ->
?state:Shape.Type.state ->
Shape.Type.op ->
Shape.Type.attr Owl_graph.nodecrate a computation graph node
val make_then_connect :
?shape:int array option array ->
Shape.Type.op ->
Shape.Type.attr Owl_graph.node array ->
Shape.Type.attr Owl_graph.nodemake nodes and then connect parents and children
val var_arr : ?shape:int array -> string -> Shape.Type.arrcreat a node and wrap in Arr type
val var_elt : string -> Shape.Type.eltcreat a node and wrap in Elt type
val const_arr : string -> Shape.Type.Device.A.arr -> Shape.Type.arrget ndarray value from input and create an node and wrap in Arr type
val const_elt : string -> Shape.Type.Device.A.elt -> Shape.Type.eltget value from input and create an node and wrap in Elt type
val make_empty_block : ?block_id:int -> int -> Shape.Type.blockmake_empty_block s returns an empty block of memory of size s.
val make_value_block :
Shape.Type.Device.value ->
Shape.Type.attr Owl_graph.node ->
unitmake_value_block value node creates a block of memory initialised with value and links the new block to node.
val get_block : Shape.Type.attr Owl_graph.node -> Shape.Type.block arrayget_block node returns the memory block allocated to node. If no block is allocated, throws an exception.
val add_node_to_block :
Shape.Type.attr Owl_graph.node ->
Shape.Type.block ->
unitLink a node to a reusable block and initialises its memory on the memory of the block.
val get_active_node : Shape.Type.block -> Shape.Type.attr Owl_graph.node optionReturn the node that is currently using the memory of the block.
val set_active_node :
Shape.Type.block ->
Shape.Type.attr Owl_graph.node ->
unitUpdate the node that is currently using the block of memory.
val get_block_id : Shape.Type.attr Owl_graph.node -> intget_block_id node returns the id of the block assigned to node. If node has not been assigned yet, returns -1.
val set_value :
Shape.Type.attr Owl_graph.node ->
Shape.Type.Device.value array ->
unitset the arrays of value to cgraph node
val get_value : Shape.Type.attr Owl_graph.node -> Shape.Type.Device.value arrayget the arrays of value of cgraph node
val set_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.op -> unitset the operator of cgraph node
val get_operator : Shape.Type.attr Owl_graph.node -> Shape.Type.opget the operator of cgraph node
val set_reuse : Shape.Type.attr Owl_graph.node -> bool -> unitset reuse attribute in a node
val get_reuse : Shape.Type.attr Owl_graph.node -> boolget reuse attribute in a node
check of the data block of memory is shared in a node
get_shared_nodes node returns the nodes sharing the same block of memory as node.
val is_var : Shape.Type.attr Owl_graph.node -> boolcheck if the node's operator is Var type
val is_const : Shape.Type.attr Owl_graph.node -> boolcheck if the node's operator is Const type
val is_node_arr : Shape.Type.attr Owl_graph.node -> boolcheck the shape of a node's attr and return if it indicates an ndarray
val is_node_elt : Shape.Type.attr Owl_graph.node -> boolcheck the shape of a node's attr and return if it indicates an elt
val is_assigned : Shape.Type.attr Owl_graph.node -> boolis_assigned node checks if a block of memory has been assigned to node.
val check_assigned : Shape.Type.attr Owl_graph.node -> unitcheck_assigned node throws an exception if node has not been assigned to a block.
val is_valid : Shape.Type.attr Owl_graph.node -> boolcheck if the state attribute of a node is Valid
val validate : Shape.Type.attr Owl_graph.node -> unitset Valid to the state attribute of a node
val invalidate : Shape.Type.attr Owl_graph.node -> unitset Invalid to the state attribute of a node
val invalidate_graph : Shape.Type.attr Owl_graph.node -> unititeratively invalidate the nodes in a graph
val is_freeze : Shape.Type.attr Owl_graph.node -> boolcheck the freeze attribute of a node
val freeze : Shape.Type.attr Owl_graph.node -> unitreturn the freeze attribute of a node
val freeze_descendants : Shape.Type.attr Owl_graph.node array -> unititeratively freeze the descendants of a node
val freeze_ancestors : Shape.Type.attr Owl_graph.node array -> unititeratively freeze the ancestors of a node
val pack_arr : Shape.Type.Device.A.arr -> Shape.Type.arrpack an A.arr type input into Arr type
val unpack_arr : Shape.Type.arr -> Shape.Type.Device.A.arrunpack input into A.arr type
val pack_elt : Shape.Type.Device.A.elt -> Shape.Type.eltpack an A.elt type input into Elt type
val unpack_elt : Shape.Type.elt -> Shape.Type.Device.A.eltunpack input into A.elt type
val unsafe_assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unitassign Arr type value
val assign_arr : Shape.Type.arr -> Shape.Type.Device.A.arr -> unitassign Arr type value
val assign_elt : Shape.Type.elt -> Shape.Type.Device.A.elt -> unitassign Elt type value
val float_to_elt : float -> Shape.Type.eltbuild an Elt type based on float value
val elt_to_float : Shape.Type.elt -> floatretrive a float value from an Elt type value