pub struct FillPlan<T: Element> { /* private fields */ }Expand description
Fill plan.
y[i] = value for all i (PyTorch torch.full).
When to use: zero-init / constant-init of output buffers, or any broadcast-fill. No BW — a constant tensor has zero gradient.
Dtypes: {f32, f64, f16, bf16, i32, i64} — every numeric
Element dtype baracuda exposes through the unified Plan
layer. u8 / i8 ship in the sys crate but on the IntElement
family (deferred plan shape).
Shape limits: flat [numel]; numel ≥ 0.
Workspace: none.
Precision guarantee: deterministic, bit-stable, bit-exact.
f16 / bf16 transport value via raw u16 bit pattern; the safe
plan layer performs the bit cast.
Implementations§
Source§impl<T: Element> FillPlan<T>
impl<T: Element> FillPlan<T>
Sourcepub fn select(
_stream: &Stream,
desc: &FillDescriptor<T>,
_pref: PlanPreference,
) -> Result<Self>
pub fn select( _stream: &Stream, desc: &FillDescriptor<T>, _pref: PlanPreference, ) -> Result<Self>
Pick a kernel for desc.
Sourcepub fn can_implement(&self, args: &FillArgs<'_, T>) -> Result<()>
pub fn can_implement(&self, args: &FillArgs<'_, T>) -> Result<()>
Validate args.
Sourcepub fn workspace_size(&self) -> usize
pub fn workspace_size(&self) -> usize
Workspace size in bytes. Always 0.
Sourcepub fn precision_guarantee(&self) -> PrecisionGuarantee
pub fn precision_guarantee(&self) -> PrecisionGuarantee
Numerical guarantees for this plan’s kernel.
Auto Trait Implementations§
impl<T> Freeze for FillPlan<T>where
T: Freeze,
impl<T> RefUnwindSafe for FillPlan<T>where
T: RefUnwindSafe,
impl<T> Send for FillPlan<T>where
T: Send,
impl<T> Sync for FillPlan<T>where
T: Sync,
impl<T> Unpin for FillPlan<T>where
T: Unpin,
impl<T> UnsafeUnpin for FillPlan<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for FillPlan<T>where
T: UnwindSafe,
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