one_hot

dragon.vm.torch.one_hot(
  input,
  depth
)[source]

Return the one-hot representation for input.

\[\text{out}_{ij} = \begin{cases} 0, & \text{ if } \text{input}_{i} \neq j \\ 1, & \text{ otherwise } \end{cases} \]
Parameters:
Returns:

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