pub struct ComputationGraph {
pub nodes: HashMap<usize, GraphNode>,
pub next_id: usize,
}Expand description
Computation graph for optimization passes
Fields§
§nodes: HashMap<usize, GraphNode>§next_id: usizeImplementations§
Source§impl ComputationGraph
impl ComputationGraph
pub fn new() -> Self
pub fn add_node(&mut self, node_type: NodeType, params: NodeParams) -> usize
pub fn connect(&mut self, from: usize, to: usize)
pub fn remove_node(&mut self, id: usize)
pub fn get_node(&self, id: usize) -> Option<&GraphNode>
pub fn get_node_mut(&mut self, id: usize) -> Option<&mut GraphNode>
Trait Implementations§
Source§impl Clone for ComputationGraph
impl Clone for ComputationGraph
Source§fn clone(&self) -> ComputationGraph
fn clone(&self) -> ComputationGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComputationGraph
impl Debug for ComputationGraph
Auto Trait Implementations§
impl Freeze for ComputationGraph
impl RefUnwindSafe for ComputationGraph
impl Send for ComputationGraph
impl Sync for ComputationGraph
impl Unpin for ComputationGraph
impl UnsafeUnpin for ComputationGraph
impl UnwindSafe for ComputationGraph
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