ClikaRT::ops::softmax
function
softmax()
Tensor softmax(
Tensor x,
int64_t dim = -1,
DataType dtype = DataType::Undefined
)
Softmax along dim, computed stably (max-subtracted).
Parameters
x: the input tensor.dim: the reduction dimension. Negative counts from the end. Default-1.dtype: output dtype;DataType::Undefined(default) keepsx's.
Throws
ClikaRT::Error: whendimis out of range, or when the dtype pair is not served (code_name()carries the reason).
Returns: same shape as x; dtype = dtype when set, else x's.
auto p = ClikaRT::ops::softmax(logits, -1);
Declared in ClikaRT/compute/ops.h, line 1050