transpose

dragon.vm.torch.transpose(
  input,
  dim0,
  dim1
)[source]

Return a new tensor with two dimensions swapped.

Parameters:
  • input (dragon.vm.torch.Tensor) – The input tensor.
  • dim0 (int) – The first dimension to be transposed.
  • dim1 (int) – The second dimension to be transposed.
Returns:

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