oa::matrix::softmax

Stable Softmax over dim, where -1 selects the last dimension. The operation records asynchronously and returns its output immediately. Errors Returns an error when the input is empty or not FP32, dim is invalid, an axis extent or dispatch count exceeds the shader ABI, allocation fails, or runtime recording fails.

FnRust public API

Function Documentation

pub fn softmax( input: &Matrix, dim: i32 ) -> Result<Matrix>
Stable Softmax over dim, where -1 selects the last dimension. The operation records asynchronously and returns its output immediately. Errors Returns an error when the input is empty or not FP32, dim is invalid, an axis extent or dispatch count exceeds the shader ABI, allocation fails, or runtime recording fails.