pub enum RngPrimsDescriptor {
Uniform,
Normal,
Integer {
low: i32,
high: i32,
},
}Expand description
Random-number generation descriptors for dense eager tensor construction.
§Examples
use tenferro_prims::RngPrimsDescriptor;
let desc = RngPrimsDescriptor::Uniform;
assert!(matches!(desc, RngPrimsDescriptor::Uniform));Variants§
Uniform
Fill the output tensor with samples from the half-open interval [0, 1).
Normal
Fill the output tensor with standard normal samples.
Integer
Fill the output tensor with integer samples from the half-open interval [low, high).
Trait Implementations§
Source§impl Clone for RngPrimsDescriptor
impl Clone for RngPrimsDescriptor
Source§fn clone(&self) -> RngPrimsDescriptor
fn clone(&self) -> RngPrimsDescriptor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RngPrimsDescriptor
impl Debug for RngPrimsDescriptor
Source§impl Hash for RngPrimsDescriptor
impl Hash for RngPrimsDescriptor
Source§impl PartialEq for RngPrimsDescriptor
impl PartialEq for RngPrimsDescriptor
impl Eq for RngPrimsDescriptor
impl StructuralPartialEq for RngPrimsDescriptor
Auto Trait Implementations§
impl Freeze for RngPrimsDescriptor
impl RefUnwindSafe for RngPrimsDescriptor
impl Send for RngPrimsDescriptor
impl Sync for RngPrimsDescriptor
impl Unpin for RngPrimsDescriptor
impl UnwindSafe for RngPrimsDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more