pub struct TernaryDescriptor<const N: usize> {
pub kind: TernaryKind,
pub shape: [i32; N],
pub element: ElementKind,
pub scale: f32,
}Expand description
Descriptor for a ternary elementwise op.
scale is used by parameterized ops (Addcmul, Addcdiv) — set to
the value multiplier from PyTorch’s torch.addcmul(c, a, b, value=k) convention. Ignored by unparameterized ops (Clamp,
Fma). Default 1.0.
Fields§
§kind: TernaryKindWhich ternary op to apply.
shape: [i32; N]Output tensor shape.
element: ElementKindElement type (shared across a, b, c, y).
scale: f32Scalar multiplier for parameterized ops (Addcmul, Addcdiv).
Unused by Clamp / Fma — pass 1.0 for those.
Trait Implementations§
Source§impl<const N: usize> Clone for TernaryDescriptor<N>
impl<const N: usize> Clone for TernaryDescriptor<N>
Source§fn clone(&self) -> TernaryDescriptor<N>
fn clone(&self) -> TernaryDescriptor<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 TernaryDescriptor<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for TernaryDescriptor<N>
impl<const N: usize> RefUnwindSafe for TernaryDescriptor<N>
impl<const N: usize> Send for TernaryDescriptor<N>
impl<const N: usize> Sync for TernaryDescriptor<N>
impl<const N: usize> Unpin for TernaryDescriptor<N>
impl<const N: usize> UnsafeUnpin for TernaryDescriptor<N>
impl<const N: usize> UnwindSafe for TernaryDescriptor<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