pub struct Graph { /* private fields */ }Expand description
Computation graph for JIT compilation.
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn add_node(&mut self, op: Op, dtype: DataType, shape: Shape) -> NodeId
pub fn add_node(&mut self, op: Op, dtype: DataType, shape: Shape) -> NodeId
Adds a node to the graph.
Sourcepub fn register_input(&mut self, name: &str, id: NodeId)
pub fn register_input(&mut self, name: &str, id: NodeId)
Registers an input node.
Sourcepub fn register_output(&mut self, name: &str, id: NodeId)
pub fn register_output(&mut self, name: &str, id: NodeId)
Registers an output node.
Sourcepub fn topological_order(&self) -> Vec<NodeId>
pub fn topological_order(&self) -> Vec<NodeId>
Returns nodes in topological order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Graph
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnwindSafe for Graph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more