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_{i}) = \frac{\exp(x_{i})}{\sum_{j} \exp(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.