pub fn channel_cat_forward<T: Triton, D: Num, const BLOCK_SIZE: i32>(
x_ptr: T::Pointer<D>,
y_ptr: T::Pointer<D>,
chunk_c: i32,
c_total: i32,
chunk_offset: i32,
)where
T::I32Tensor: Tensor<i32, 1> + Comparison<i32, BoolTensor = T::BoolTensor>,
T::Pointer<D>: AddOffsets<i32, 1, T::I32Tensor, Output = T::Tensor<T::Pointer<D>>>,Expand description
Channel-wise concatenation forward — NC layout.
Copies one input chunk into the channel region [chunk_offset, chunk_offset + chunk_c)
of a wide output NC tensor. Call once per input tensor to build the full concat.
Index mapping:
y[n * c_total + chunk_offset + ci] = x[n * chunk_c + ci]
This is the structural inverse of channel_chunk_forward. The backward
of this op is channel_chunk_forward with the same parameters.
Grid: n_spatial * cdiv(chunk_c, BLOCK_SIZE) CTAs.