block_major_patch_index

Function block_major_patch_index 

Source
pub fn block_major_patch_index(
    patch_row: usize,
    patch_col: usize,
    grid_w: usize,
    merge: usize,
) -> usize
Expand description

2026-09-25: Index of the patch at (patch_row, patch_col) in the 2×2-block-major stream the GLM tower expects.

((h_block * w_blocks + w_block) * merge + row_in_block) * merge + col_in_block. The tower’s 2×2 downsample folds four consecutive tokens into one block, which is correct only in this order.