pub struct RandomDescriptor<const N: usize> {
pub kind: RandomKind,
pub shape: [i32; N],
pub element: ElementKind,
pub param1: f32,
pub param2: f32,
pub seed: u64,
}Expand description
Descriptor for a random-generator op.
Fields§
§kind: RandomKindWhich distribution.
shape: [i32; N]Output tensor shape. Must be all-positive when total numel > 0.
element: ElementKindOutput element type. For RandomKind::Uniform / RandomKind::Normal
this is the produced FP type (f32 / f64). For
RandomKind::Bernoulli this is ElementKind::Bool —
the descriptor’s type parameter T is Bool.
param1: f32For Uniform: low. For Normal: mean. For Bernoulli: probability p.
param2: f32For Uniform: high. For Normal: stddev. Ignored for Bernoulli.
seed: u64Deterministic seed. Each descriptor carries its own RNG state; re-running the same plan with the same descriptor and shape reproduces the same sequence.
Trait Implementations§
Source§impl<const N: usize> Clone for RandomDescriptor<N>
impl<const N: usize> Clone for RandomDescriptor<N>
Source§fn clone(&self) -> RandomDescriptor<N>
fn clone(&self) -> RandomDescriptor<N>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<const N: usize> Copy for RandomDescriptor<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for RandomDescriptor<N>
impl<const N: usize> RefUnwindSafe for RandomDescriptor<N>
impl<const N: usize> Send for RandomDescriptor<N>
impl<const N: usize> Sync for RandomDescriptor<N>
impl<const N: usize> Unpin for RandomDescriptor<N>
impl<const N: usize> UnsafeUnpin for RandomDescriptor<N>
impl<const N: usize> UnwindSafe for RandomDescriptor<N>
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