pub trait TensorCreator: Sized + HasDevice {
    fn new_boxed(data: Box<Self::Array>) -> Self;

    fn new(data: Self::Array) -> Self { ... }
    fn zeros() -> Self { ... }
    fn ones() -> Self
    where
        Self::Dtype: One
, { ... } fn rand<R: Rng>(rng: &mut R) -> Self
    where
        Standard: Distribution<Self::Dtype>
, { ... } fn randn<R: Rng>(rng: &mut R) -> Self
    where
        StandardNormal: Distribution<Self::Dtype>
, { ... } }
Expand description

Something that can be created - currently only implemented for tensors with no tapes.

Required Methods

Create a new tensor with a Box<Self::Array>.

Provided Methods

Create a new tensor with Self::Array on the stack. This just boxes Self::Array and calls TensorCreator::new_boxed.

Creates a tensor filled with all 0s.

Creates a tensor filled with all 1s.

Creates a tensor filled with values sampled from Standard distribution.

Creates a tensor filled with values sampled from StandardNormal distribution.

Implementors