pub enum ChainStep {
Activation(Activation, ChainOperand),
Cast(DType, ChainOperand),
Binary(BinaryOp, ChainOperand, ChainOperand),
Compare(CmpOp, ChainOperand, ChainOperand),
Where(ChainOperand, ChainOperand, ChainOperand),
}Expand description
One step in a fused element-wise chain. Each step produces exactly
one scalar result (per element); later steps can refer to it via
ChainOperand::Step. The whole chain runs per element in registers.
Variants§
Activation(Activation, ChainOperand)
Cast(DType, ChainOperand)
Binary(BinaryOp, ChainOperand, ChainOperand)
Compare(CmpOp, ChainOperand, ChainOperand)
Where(ChainOperand, ChainOperand, ChainOperand)
3-input element-wise select: cond ? on_true : on_false. Mirrors
Op::Where inside a chain. cond is treated as truthy iff
non-zero. Lets the optimizer fold attention masks / clamp-style
patterns into a single region kernel instead of breaking the
chain at the first Op::Where.
Trait Implementations§
impl StructuralPartialEq for ChainStep
Auto Trait Implementations§
impl Freeze for ChainStep
impl RefUnwindSafe for ChainStep
impl Send for ChainStep
impl Sync for ChainStep
impl Unpin for ChainStep
impl UnsafeUnpin for ChainStep
impl UnwindSafe for ChainStep
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