Transpose

class dragon.vm.tensorlayer.layers.Transpose(
  perm=None,
  name=None
)[source]

The layer to permute the dimensions of input.

Examples:

x = tl.layers.Input([8, 4, 3])

# Specify a explict permutation
y = tl.layers.Transpose(perm=[0, 2, 1])(x)  # [8, 4, 3] -> [8, 3, 4]

# Or simply inverse all the dimensions
z = tl.layers.Transpose()(x)  # [8, 4, 3] -> [3, 4, 8]

__init__

Transpose.__init__(
  perm=None,
  name=None
)[source]

Create a Transpose layer.

Parameters:
  • perm (Sequence[int], optional) – The permutation of new dimensions.
  • name (str, optional) – The optional layer name.