Struct primitiv::Graph
[−]
[src]
pub struct Graph { /* fields omitted */ }
Computation graph.
Methods
impl Graph
[src]
pub fn new() -> Self
[src]
Creates a new Graph object.
pub fn set_default(graph: &mut Self)
[src]
Specifies a new default graph.
pub fn clear(&mut self)
[src]
Clear all operators in the graph.
Remark: After calling this method, all Node objects supplied by the graph itself is invalidated.
pub fn forward(&mut self, node: &Node) -> Tensor
[src]
Calculates the value of given node.
pub fn backward(&mut self, node: &Node)
[src]
Calculates the backpropagation.
pub fn get_shape(&self, node: &Node) -> Shape
[src]
Retrieves the shape of the node.
pub fn get_device(&self, node: &Node) -> AnyDevice
[src]
Retrieves the device of the node.
pub fn dump(&self, format: &str) -> String
[src]
Dump internal graph structure.
Available options:
- “dot” … Graphviz’s dot format.
pub fn num_operators(&self) -> u32
[src]
Returns the number of operators in the computation graph.
Trait Implementations
impl Debug for Graph
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more