123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384# 1 "src/base/compute/owl_computation_graph_sig.ml"(*
* OWL - OCaml Scientific Computing
* Copyright (c) 2016-2022 Liang Wang <liang@ocaml.xyz>
*)moduletypeSig=sigmoduleOptimiser:Owl_computation_optimiser_sig.SigopenOptimiser.Operator.Symbol.Shape.TypeopenOptimiser.Operator.Symbol.Shape.Type.Device(** {5 Type definition} *)typegraph(** {5 Core functions} *)valshape_or_value:t->string(** print shape for ndarrays, whilst value for scalars *)valgraph_to_dot:graph->string(** generate a string that can be written to a .dot file to draw the graph *)valgraph_to_trace:graph->string(** print the graph structure to a string *)valsave_graph:'a->string->unit(** save the graph object to a file with given name, using marshall format *)valload_graph:string->'a*'b(** load the graph object from a file with given name *)valcollect_rvs:attrOwl_graph.nodearray->attrOwl_graph.nodearray(** traverse each node in the input array, and return the random variable type nodes. *)valinvalidate_rvs:graph->unit(** TODO *)valmake_graph:input:attrOwl_graph.nodearray->output:attrOwl_graph.nodearray->string->graph(** Build a graph based on input nodes, output nodes, and graph name *)valget_inputs:graph->attrOwl_graph.nodearray(** get input nodes of a graph *)valget_outputs:graph->attrOwl_graph.nodearray(** get output nodes of a graph *)valget_node_arr_val:attrOwl_graph.node->A.arrvalget_node_elt_val:attrOwl_graph.node->A.eltvalset_node_arr_val:attrOwl_graph.node->value->unitvalset_node_elt_val:attrOwl_graph.node->value->unitvalis_iopair_safe:'aOwl_graph.node->'aOwl_graph.node->boolvalmake_iopair:graph->attrOwl_graph.nodearray->attrOwl_graph.nodearray->unit(** create an iopair between the input nodes and output nodes in a graph *)valupdate_iopair:graph->unitvalremove_unused_iopair:'aOwl_graph.nodearray->'barray->'aOwl_graph.nodearray*'barray(** remove unuserd iopair from an array of nodes *)valinit_inputs:(attrOwl_graph.node->value)->graph->unit(** initialize inputs nodes of a graph with given function [f] *)valoptimise:graph->unit(** optimise the graph structure *)end