[][src]Struct auto_diff::compute_graph::Net

pub struct Net { /* fields omitted */ }

The computation network. Connection has duplication.

Implementations

impl Net[src]

pub fn new() -> Net[src]

pub fn get_data(&self) -> &GenIndex<Tensor>

Important traits for GenIndex<T>

impl<T> Iterator for GenIndex<T> type Item = NetIndex;
[src]

pub fn get_data_mut(&mut self) -> &mut GenIndex<Tensor>

Important traits for GenIndex<T>

impl<T> Iterator for GenIndex<T> type Item = NetIndex;
[src]

pub fn get_op(&self, func: &Func) -> Option<&Op>[src]

pub fn is_dangling_var(&self, var: &Var) -> Result<bool, ()>[src]

pub fn get_grad(&self) -> &BTreeMap<NetIndex, Tensor>[src]

pub fn get_func_output(&self, func: &Func) -> Option<NetIndex>[src]

Return one output variable id if there is one.

pub fn init_var(&mut self) -> NetIndex[src]

Insert an empty var into the network.

pub fn del_var(&mut self, var: &Var)[src]

pub fn init_op(&mut self, op: Op) -> NetIndex[src]

Insert operator into the network.

pub fn init_func(&mut self, funcs: &[NetIndex]) -> NetIndex[src]

For Module::func, insert a new composed func.

pub fn del_func_or_op(&mut self, func: &Func)[src]

Remove a concrete op or composed func from the graph.

pub fn decouple_input(&mut self, func: &Func) -> Vec<NetIndex>[src]

Disconnect the variable and the function the variable is the input. Delete the variable if it becomes the dangling variable.

pub fn get_sub_func(&self, func: NetIndex) -> Vec<NetIndex>[src]

Return a vec of sub ops for the given op. Empty should be returned if the input is a concrete op.

pub fn is_composed(&self, func: &Func) -> Result<bool, ()>[src]

Check the func is concrete or not.

pub fn connect(&mut self, input: &[NetIndex], op: Op, output: &[NetIndex])[src]

Build input-operator-output relation, with given components.

pub fn connect2(&mut self, input: &[&Var], func: &Func, output: &[&Var])[src]

pub fn set_mark(&mut self, did: &NetIndex)[src]

set the set_mark, set_mark is used to label var with input value with it.

pub fn unset_mark(&mut self, did: &NetIndex)[src]

pub fn eval(&mut self) -> Result<(), BTreeSet<NetIndex>>[src]

Merge two computation graph Forward evaluate the computaiton graph.

pub fn eval_op(&self, input: &[&Var], func: &Func, output: &[&Var])[src]

pub fn bptt_scale(&mut self, r: f32)[src]

pub fn bptt(&mut self, output_grad: &BTreeMap<NetIndex, Tensor>)[src]

pub fn visit_op<F>(
    &mut self,
    closure: F,
    allow: Option<Vec<NetIndex>>,
    skip: Option<Vec<NetIndex>>
) where
    F: Fn(&Op), 
[src]

Iterate over all ops, no order guarantee

pub fn visit_data<F>(&mut self, closure: F) where
    F: Fn(NetIndex, &Tensor), 
[src]

Auto Trait Implementations

impl !RefUnwindSafe for Net

impl !Send for Net

impl !Sync for Net

impl Unpin for Net

impl !UnwindSafe for Net

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,