mindspore.ops.Softmax

class mindspore.ops.Softmax(axis=- 1)[source]

Applies the Softmax operation to the input tensor on the specified axis.

Refer to mindspore.ops.softmax() for more details.

Supported Platforms:

Ascend GPU CPU

Examples

>>> logits = Tensor(np.array([1, 2, 3, 4, 5]), mindspore.float32)
>>> softmax = ops.Softmax()
>>> output = softmax(logits)
>>> print(output)
[0.01165623 0.03168492 0.08612854 0.23412167 0.6364086 ]