_transpose
transpose
¶
Transpose the tensor
.
This method can be used with Numpy data:
n = np.array([[0,1,2],[3,4,5],[6,7,8]])
b = fe.backend.transpose(n) # [[0, 3, 6], [1, 4, 7], [2, 5, 8]]
This method can be used with TensorFlow tensors:
t = tf.constant([[0,1,2],[3,4,5],[6,7,8]])
b = fe.backend.transpose(t) # [[0, 3, 6], [1, 4, 7], [2, 5, 8]]
This method can be used with PyTorch tensors:
p = torch.tensor([[0,1,2],[3,4,5],[6,7,8]])
b = fe.backend.transpose(p) # [[0, 3, 6], [1, 4, 7], [2, 5, 8]]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tensor |
Tensor
|
The input value. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
The transposed |
Raises:
Type | Description |
---|---|
ValueError
|
If |