123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224# 1 "src/base/compute/owl_computation_symbol_sig.ml"(*
* OWL - OCaml Scientific and Engineering Computing
* Copyright (c) 2016-2020 Liang Wang <liang.wang@cl.cam.ac.uk>
*)(* Functor of making the symbols of a computation graph. *)moduletypeSig=sigmoduleShape:Owl_computation_shape_sig.SigopenShapeopenTypeopenDevice(** {6 Core functions} *)valop_to_str:op->string(** TODO *)valis_random_variable:op->bool(** TODO *)valrefnum:'aOwl_graph.node->int(** TODO *)valnode_shape:attrOwl_graph.node->intarray(** TODO *)valnode_numel:attrOwl_graph.node->int(** TODO *)valis_shape_unknown:attrOwl_graph.node->bool(** TODO *)valinfer_shape_graph:attrOwl_graph.nodearray->unit(** TODO *)valshape_to_str:intarrayoptionarray->string(** TODO *)valnode_to_str:attrOwl_graph.node->string(** TODO *)valnode_to_arr:t->arr(** TODO *)valarr_to_node:arr->t(** TODO *)valnode_to_elt:t->elt(** TODO *)valelt_to_node:elt->t(** TODO *)valmake_node:?name:string->?value:valuearray->?shape:intarrayoptionarray->?freeze:bool->?reuse:bool->?state:state->op->attrOwl_graph.node(** TODO *)valmake_then_connect:?shape:intarrayoptionarray->op->attrOwl_graph.nodearray->attrOwl_graph.node(** TODO *)valvar_arr:?shape:intarray->string->arr(** TODO *)valvar_elt:string->elt(** TODO *)valconst_arr:string->A.arr->arr(** TODO *)valconst_elt:string->A.elt->elt(** TODO *)valnew_block_id:unit->int(** ``new_block_id ()`` returns an unused block id. *)valmake_empty_block:?block_id:int->int->block(** ``make_empty_block s`` returns an empty block of memory of size ``s``. *)valmake_value_block:value->attrOwl_graph.node->unit(**
``make_value_block value node`` creates a block of memory initialised with
``value`` and links the new block to ``node``.
*)valget_block:attrOwl_graph.node->blockarray(**
``get_block node`` returns the memory block allocated to ``node``.
If no block is allocated, throws an exception.
*)valadd_node_to_block:attrOwl_graph.node->block->unit(**
Link a node to a reusable block and initialises its memory on the memory of
the block.
*)valget_active_node:block->attrOwl_graph.nodeoption(** Return the node that is currently using the memory of the block. *)valset_active_node:block->attrOwl_graph.node->unit(** Update the node that is currently using the block of memory. *)valget_block_id:attrOwl_graph.node->int(**
``get_block_id node`` returns the id of the block assigned to ``node``. If
``node`` has not been assigned yet, returns ``-1``.
*)valset_value:attrOwl_graph.node->valuearray->unit(** TODO *)valget_value:attrOwl_graph.node->valuearray(** TODO *)valset_operator:attrOwl_graph.node->op->unit(** TODO *)valget_operator:attrOwl_graph.node->op(** TODO *)valset_reuse:attrOwl_graph.node->bool->unit(** TODO *)valget_reuse:attrOwl_graph.node->bool(** TODO *)valis_shared:attrOwl_graph.node->bool(** TODO *)valget_shared_nodes:attrOwl_graph.node->attrOwl_graph.nodearray(**
``get_shared_nodes node`` returns the nodes sharing the same block of memory
as ``node``.
*)valis_var:attrOwl_graph.node->bool(** TODO *)valis_const:attrOwl_graph.node->bool(** TODO *)valis_node_arr:attrOwl_graph.node->bool(** TODO *)valis_node_elt:attrOwl_graph.node->bool(** TODO *)valis_assigned:attrOwl_graph.node->bool(**
``is_assigned node`` checks if a block of memory has been assigned to
``node``.
*)valcheck_assigned:attrOwl_graph.node->unit(**
``check_assigned node`` throws an exception if ``node`` has not been
assigned to a block.
*)valis_valid:attrOwl_graph.node->bool(** TODO *)valvalidate:attrOwl_graph.node->unit(** TODO *)valinvalidate:attrOwl_graph.node->unit(** TODO *)valinvalidate_graph:attrOwl_graph.node->unit(** TODO *)valis_freeze:attrOwl_graph.node->bool(** TODO *)valfreeze:attrOwl_graph.node->unit(** TODO *)valfreeze_descendants:attrOwl_graph.nodearray->unit(** TODO *)valfreeze_ancestors:attrOwl_graph.nodearray->unit(** TODO *)valpack_arr:A.arr->arr(** TODO *)valunpack_arr:arr->A.arr(** TODO *)valpack_elt:A.elt->elt(** TODO *)valunpack_elt:elt->A.elt(** TODO *)valunsafe_assign_arr:arr->A.arr->unit(** TODO *)valassign_arr:arr->A.arr->unit(** TODO *)valassign_elt:elt->A.elt->unit(** TODO *)valfloat_to_elt:float->elt(** TODO *)valelt_to_float:elt->float(** TODO *)end