Trait burn_tensor::ElementRandom

source ·
pub trait ElementRandom {
    // Required method
    fn random<R: RngCore>(distribution: Distribution, rng: &mut R) -> Self;
}
Expand description

Element trait for random value of a tensor.

Required Methods§

source

fn random<R: RngCore>(distribution: Distribution, rng: &mut R) -> Self

Returns a random value for the given distribution.

§Arguments
  • distribution - The distribution to sample from.
  • rng - The random number generator.
§Returns

The random value.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ElementRandom for bool

source§

fn random<R: RngCore>(distribution: Distribution, rng: &mut R) -> Self

source§

impl ElementRandom for f32

source§

fn random<R: RngCore>(distribution: Distribution, rng: &mut R) -> Self

source§

impl ElementRandom for f64

source§

fn random<R: RngCore>(distribution: Distribution, rng: &mut R) -> Self

source§

impl ElementRandom for i8

source§

fn random<R: RngCore>(distribution: Distribution, rng: &mut R) -> Self

source§

impl ElementRandom for i16

source§

fn random<R: RngCore>(distribution: Distribution, rng: &mut R) -> Self

source§

impl ElementRandom for i32

source§

fn random<R: RngCore>(distribution: Distribution, rng: &mut R) -> Self

source§

impl ElementRandom for i64

source§

fn random<R: RngCore>(distribution: Distribution, rng: &mut R) -> Self

source§

impl ElementRandom for u8

source§

fn random<R: RngCore>(distribution: Distribution, rng: &mut R) -> Self

source§

impl ElementRandom for u32

source§

fn random<R: RngCore>(distribution: Distribution, rng: &mut R) -> Self

source§

impl ElementRandom for u64

source§

fn random<R: RngCore>(distribution: Distribution, rng: &mut R) -> Self

Implementors§