Trait Random

Source
pub trait Random {
    type TensorType;
    type ElementType;

    // Required methods
    fn rand_usize(
        rng: &mut StdRng,
        dim: &[usize],
        left: usize,
        right: usize,
    ) -> Self::TensorType;
    fn bernoulli() -> Self::TensorType;
    fn cauchy() -> Self::TensorType;
    fn exponential() -> Self::TensorType;
    fn geometric() -> Self::TensorType;
    fn log_normal() -> Self::TensorType;
    fn normal(
        rng: &mut StdRng,
        dim: &[usize],
        mean: Self::ElementType,
        std: Self::ElementType,
    ) -> Self::TensorType;
    fn uniform(
        rng: &mut StdRng,
        dim: &[usize],
        from: Self::ElementType,
        to: Self::ElementType,
    ) -> Self::TensorType;
}

Required Associated Types§

Required Methods§

Source

fn rand_usize( rng: &mut StdRng, dim: &[usize], left: usize, right: usize, ) -> Self::TensorType

Generate a random int close on left, open on right.

Source

fn bernoulli() -> Self::TensorType

Source

fn cauchy() -> Self::TensorType

Source

fn exponential() -> Self::TensorType

Source

fn geometric() -> Self::TensorType

Source

fn log_normal() -> Self::TensorType

Source

fn normal( rng: &mut StdRng, dim: &[usize], mean: Self::ElementType, std: Self::ElementType, ) -> Self::TensorType

Source

fn uniform( rng: &mut StdRng, dim: &[usize], from: Self::ElementType, to: Self::ElementType, ) -> Self::TensorType

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§