def convert_row_to_sdpa_index(block_struct, row_offsets, row):
block_index = bisect_left(row_offsets[<NUM_LIT:1>:], row + <NUM_LIT:1>)<EOL>width = block_struct[block_index]<EOL>row = row - row_offsets[block_index]<EOL>i, j = divmod(row, width)<EOL>return block_index, i, j<EOL>
Helper function to map to sparse SDPA index values.