[][src]Struct tch::nn::Path

pub struct Path<'a> { /* fields omitted */ }

A variable store with an associated path for variables naming.

Implementations

impl<'a> Path<'a>[src]

pub fn sub<T: ToString>(&'a self, s: T) -> Path<'a>[src]

Gets a sub-path of the given path.

pub fn device(&self) -> Device[src]

Gets the device where the var-store variables are stored.

pub fn zeros_no_train(&self, name: &str, dims: &[i64]) -> Tensor[src]

Creates a new variable initialized with zeros.

The new variable is named according to the name parameter and has the specified shape. The variable will not be trainable so gradients will not be tracked. The variable uses a float tensor initialized with zeros.

pub fn ones_no_train(&self, name: &str, dims: &[i64]) -> Tensor[src]

Creates a new variable initialized with ones.

The new variable is named according to the name parameter and has the specified shape. The variable will not be trainable so gradients will not be tracked. The variable uses a float tensor initialized with ones.

pub fn var(&self, name: &str, dims: &[i64], init: Init) -> Tensor[src]

Creates a new variable.

The new variable is named according to the name parameter and has the specified shape. The variable is trainable, its gradient will be tracked. The variable uses a float tensor initialized as per the related argument.

pub fn zeros(&self, name: &str, dims: &[i64]) -> Tensor[src]

Creates a new variable initialized with zeros.

The new variable is named according to the name parameter and has the specified shape. The variable is trainable, its gradient will be tracked. The variable uses a float tensor initialized with zeros.

pub fn ones(&self, name: &str, dims: &[i64]) -> Tensor[src]

Creates a new variable initialized with ones.

The new variable is named according to the name parameter and has the specified shape. The variable is trainable, its gradient will be tracked. The variable uses a float tensor initialized with ones.

pub fn randn_standard(&self, name: &str, dims: &[i64]) -> Tensor[src]

Creates a new variable initialized randomly with normal distribution.

The new variable is named according to the name parameter and has the specified shape. The variable is trainable, its gradient will be tracked. The variable uses a float tensor initialized randomly using a standard normal distribution.

pub fn randn(&self, name: &str, dims: &[i64], mean: f64, stdev: f64) -> Tensor[src]

Creates a new variable initialized randomly with normal distribution.

The new variable is named according to the name parameter and has the specified shape. The variable is trainable, its gradient will be tracked. The variable uses a float tensor initialized randomly using a normal distribution with the specified mean and standard deviation.

pub fn uniform(&self, name: &str, dims: &[i64], lo: f64, up: f64) -> Tensor[src]

Creates a new variable initialized randomly with uniform distribution.

The new variable is named according to the name parameter and has the specified shape. The variable is trainable, its gradient will be tracked. The variable uses a float tensor initialized randomly using a uniform distribution between the specified bounds.

pub fn kaiming_uniform(&self, name: &str, dims: &[i64]) -> Tensor[src]

Creates a new variable initialized randomly with kaiming uniform.

The new variable is named according to the name parameter and has the specified shape. The variable is trainable, its gradient will be tracked. The variable uses a float tensor initialized randomly using a uniform distribution which bounds follow Kaiming initialization.

pub fn var_copy(&self, name: &str, t: &Tensor) -> Tensor[src]

Creates a new variable initialized by copying an existing tensor.

The new variable is named according to the name parameter and has the specified shape. The variable is trainable, its gradient will be tracked. The variable uses a float tensor initialized by copying some given tensor.

pub fn get(&self, name: &str) -> Option<Tensor>[src]

Gets the tensor corresponding to a given name if present.

pub fn entry<'b>(&'b self, name: &'b str) -> Entry<'b>[src]

Gets the entry corresponding to a given name for in-place manipulation.

Trait Implementations

impl<'a> Debug for Path<'a>[src]

impl<'a, T> Div<T> for &'a mut Path<'a> where
    T: ToString
[src]

type Output = Path<'a>

The resulting type after applying the / operator.

impl<'a, T> Div<T> for &'a Path<'a> where
    T: ToString
[src]

type Output = Path<'a>

The resulting type after applying the / operator.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Path<'a>

impl<'a> Send for Path<'a>

impl<'a> Sync for Path<'a>

impl<'a> Unpin for Path<'a>

impl<'a> UnwindSafe for Path<'a>

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>,