softmax

dragon.vm.torch.nn.functional.softmax(
  input,
  dim,
  inplace=False
)[source]

Apply the softmax function to input.

The Softmax function is defined as:

\[\text{Softmax}(x) = \frac{e^{x_{i}}}{\sum e^{x_{j}}} \]
Parameters:
  • input (dragon.vm.torch.Tensor) – The input tensor.
  • dim (int) – The dimension to reduce.
  • inplace (bool, optional, default=False) – Whether to do the operation in-place.
Returns:

dragon.vm.torch.Tensor – The output tensor.