Trait dfdx::tensor::TensorCreator
source · [−]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
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 values sampled from Standard distribution.
fn randn<R: Rng>(rng: &mut R) -> Self where
StandardNormal: Distribution<Self::Dtype>,
fn randn<R: Rng>(rng: &mut R) -> Self where
StandardNormal: Distribution<Self::Dtype>,
Creates a tensor filled with values sampled from StandardNormal distribution.