Skip to main content

channel_chunk_backward

Function channel_chunk_backward 

Source
pub fn channel_chunk_backward<T: Triton, D: Num, const BLOCK_SIZE: i32>(
    dy_ptr: T::Pointer<D>,
    dx_ptr: T::Pointer<D>,
    c_total: i32,
    chunk_c: 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 chunk backward — propagates the gradient of one chunk output back into the full-width input gradient tensor.

Index mapping: dx[n * c_total + chunk_offset + ci] = dy[n * chunk_c + ci]

No atomic operations are required: each chunk’s backward writes to a disjoint channel range [chunk_offset, chunk_offset + chunk_c) of dx.

Grid: same as channel_chunk_forward.