transpose¶
dragon.vm.tensorflow.
transpose
(
a,
perm=None,
name=None
)[source]¶Permute the dimensions of input.
Examples:
# Provide the permutation for all axes x = tf.ones(shape=(2, 3, 4)) print(tf.transpose(x, (0, 2, 1)).shape) # (2, 4, 3) # Or dimensions will be simply inverse print(tf.transpose(x).shape) # (4, 3, 2)
- Parameters:
- a (dragon.Tensor) – The input tensor.
- perm (Sequence[Union[int, dragon.Tensor]]) – The output permutation.
- name (str, optional) – The operation name.
- Returns:
dragon.Tensor – The output tensor.