Struct tch::nn::Path [−][src]
pub struct Path<'a> { /* fields omitted */ }
Expand description
A variable store with an associated path for variables naming.
Implementations
Get the components of the path.
Casts all variables in a var store sub-path to the target kind .
Only the variable in the path sub-tree are cast to the target kind:
other var store variables are unaffected. For floating-point conversion, methods
half
, bfloat16
, float
and double
should be preferred as they ensure only
float-like variables will be converted to the target type.
Casts all float-like variables in a var store sub-path to half-precision (Half kind).
Only the variable in the path sub-tree are cast to half-precision: other var store variables are unaffected
Casts all float-like variables in a var store sub-path to bfloat16-precision (BFloat16 kind).
Only the variable in the path sub-tree are cast to bfloat16-precision: other var store variables are unaffected
Casts all float-like variables in a var store sub-path to single-precision (Float kind).
Only the variable in the path sub-tree are cast to single-precision: other var store variables are unaffected
Casts all float-like variables in a var store sub-path to double-precision (Double kind).
Only the variable in the path sub-tree are cast to double-precision: other var store variables are unaffected
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Gets the tensor corresponding to a given name if present.