transpose

dragon.transpose(
  inputs,
  perm=None,
  **kwargs
)[source]

Permute the dimensions of input.

Examples:

# Provide the permutation for all axes
x = dragon.ones(shape=(2, 3, 4))
print(dragon.transpose(x, (0, 2, 1)).shape)  # (2, 4, 3)

# Or dimensions will be simply inverse
print(dragon.transpose(x).shape)  # (4, 3, 2)
Parameters:
Returns:

dragon.Tensor – The output tensor.