Reject zero-dimension block_row_indices in SparseAttention

Merged
AP
5mo ago
+33-0

This pull request strengthens the validation logic for the block_row_indices input in the SparseAttention operator and adds a corresponding unit test to ensure that zero-dimension cases are properly rejected.

Validation improvements:

  • Updated the check in Status CheckInputs (in sparse_attention_helper.h) to require that the first dimension of block_row_indices is greater than zero, preventing invalid zero-dimension input.

Test coverage:

  • Added a new unit test RejectsZeroDimBlockRowIndices in sparse_attention_op_test.cc to verify that the operator correctly rejects inputs where block_row_indices has a zero in its first dimension.