Compute the softmax function over a specified dimension of an input tensor:
where represents elements along the specified dimension , and is the size of dimension .
input of arbitrary shape dim (): Dimension to compute softmax over (0-based indexing)shape: Array containing the dimensions of the input tensorndim (): Number of dimensions in the input tensoroutput with the same shape as input, containing the softmax probabilitiesSample Run Results
Hit "Run" to test your code with sample inputs
Loading editor...
CUDA C++ environment
For the best coding experience, please switch to a desktop device to write and submit your solution.