[][src]Struct auto_diff::var::Var

pub struct Var { /* fields omitted */ }

Introduce variable to the system by creating Var

Implementations

impl Var[src]

pub fn _default() -> Var[src]

pub fn _new(id: NetIndex, net: Rc<RefCell<Net>>) -> Var[src]

pub fn new_attached(&self) -> Var[src]

Create a variable using an existing variable.

pub fn new_variable(net: Rc<RefCell<Net>>) -> Var[src]

Create a variable given the network. This is for whoever has a network handler.

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

Getter for the id member.

pub fn set_id(&mut self, new_id: NetIndex)[src]

Setter for the id member.

pub fn set(&self, v: Tensor)[src]

Give the variable a value

let mut m = Module::new();
let a = m.var();
a.set(Tensor::new());

pub fn unset(&self)[src]

pub fn get(&self) -> Tensor[src]

Get the underlying tensor.

pub fn get_grad(&self) -> Tensor[src]

Get the underlying gradient tensor.

pub fn to(&self, op: &Op) -> Var[src]

apply the var to pre-faburacated op.

pub fn backward(&self, og: f32)[src]

pub fn size(&self) -> Vec<usize>[src]

pub fn numel(&self) -> usize[src]

pub fn add(&self, o: &Var) -> Var[src]

pub fn sub(&self, o: &Var) -> Var[src]

pub fn mul(&self, o: &Var) -> Var[src]

pub fn div(&self, o: &Var) -> Var[src]

Trait Implementations

impl Display for Var[src]

impl Drop for Var[src]

Auto Trait Implementations

impl !RefUnwindSafe for Var

impl !Send for Var

impl !Sync for Var

impl Unpin for Var

impl !UnwindSafe for Var

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> ToString for T where
    T: Display + ?Sized
[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>,