oa::matrix::sample_logits
Sample one I32 class index from each final-axis row of FP32 logits. Nonpositive temperature selects the first maximum deterministically. Positive temperature uses the donor Philox categorical route; positive top_k restricts candidates and top_p applies nucleus truncation after descending TopK. Rank-one input is treated as one row. Errors Returns an error when logits are not nonempty rank-one or rank-two FP32, a sorted candidate count exceeds 1024, sizes do not fit the shader ABI, allocation fails, or runtime recording fails.
Function Documentation
Sample one I32 class index from each final-axis row of FP32 logits. Nonpositive temperature selects the first maximum deterministically. Positive temperature uses the donor Philox categorical route; positive top_k restricts candidates and top_p applies nucleus truncation after descending TopK. Rank-one input is treated as one row. Errors Returns an error when logits are not nonempty rank-one or rank-two FP32, a sorted candidate count exceeds 1024, sizes do not fit the shader ABI, allocation fails, or runtime recording fails.