pub struct ConcatPlan<T: Element, const N: usize> { /* private fields */ }Expand description
2-input concat plan.
y = cat(a, b, dim=concat_dim) (PyTorch torch.cat).
When to use: residual joins, KV-cache concat in attention, any
2-input concatenation. Variable-arity (N-input) concat needs a
separate plan with device-side pointer arrays — deferred. Pair
with ConcatBackwardPlan.
Dtypes: {f32, f64, f16, bf16}.
Shape limits: rank in [1, 8]; a_shape and b_shape must
match on every axis except concat_dim; concat_dim ∈ [0, N).
Workspace: none.
Precision guarantee: deterministic, bit-stable, bit-exact (pure load + store).
Implementations§
Source§impl<T: Element, const N: usize> ConcatPlan<T, N>
impl<T: Element, const N: usize> ConcatPlan<T, N>
Sourcepub fn select(
_stream: &Stream,
desc: &ConcatDescriptor<N>,
_pref: PlanPreference,
) -> Result<Self>
pub fn select( _stream: &Stream, desc: &ConcatDescriptor<N>, _pref: PlanPreference, ) -> Result<Self>
Pick a kernel for desc.
Sourcepub fn can_implement(&self, args: &ConcatArgs<'_, T, N>) -> Result<()>
pub fn can_implement(&self, args: &ConcatArgs<'_, T, N>) -> Result<()>
Validate args.
Sourcepub fn workspace_size(&self) -> usize
pub fn workspace_size(&self) -> usize
Workspace size in bytes. Always 0 for the trailblazer.
Sourcepub fn precision_guarantee(&self) -> PrecisionGuarantee
pub fn precision_guarantee(&self) -> PrecisionGuarantee
Numerical guarantees.
Auto Trait Implementations§
impl<T, const N: usize> Freeze for ConcatPlan<T, N>
impl<T, const N: usize> RefUnwindSafe for ConcatPlan<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for ConcatPlan<T, N>where
T: Send,
impl<T, const N: usize> Sync for ConcatPlan<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for ConcatPlan<T, N>where
T: Unpin,
impl<T, const N: usize> UnsafeUnpin for ConcatPlan<T, N>
impl<T, const N: usize> UnwindSafe for ConcatPlan<T, N>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