video_sparse_attn
¶
Classes¶
Functions¶
fastvideo.attention.backends.video_sparse_attn.construct_variable_block_sizes
cached
¶
construct_variable_block_sizes(dit_seq_shape: tuple[int, int, int], num_tiles: tuple[int, int, int], device: device) -> LongTensor
Compute the number of valid (non‑padded) tokens inside every
(ts_t × ts_h × ts_w) tile after padding ‑‑ flattened in the order
(t‑tile, h‑tile, w‑tile) that rearrange uses.
Returns¶
torch.LongTensor # shape: [∏ full_window_size]