Transpose the input tensor similar to numpy.transpose. Args: x (Tensor): Input tensor perm (list of ints): A list of integers. By default, reverse the dimensions, otherwise permute the axes according to the values given. Returns: Tensor, the output
(x, shape)
| 2644 | |
| 2645 | |
| 2646 | def transpose(x, shape): |
| 2647 | """ |
| 2648 | Transpose the input tensor similar to numpy.transpose. |
| 2649 | Args: |
| 2650 | x (Tensor): Input tensor |
| 2651 | perm (list of ints): A list of integers. By default, reverse the |
| 2652 | dimensions, otherwise permute the axes according to the values given. |
| 2653 | Returns: |
| 2654 | Tensor, the output |
| 2655 | """ |
| 2656 | return Transpose(shape)(x)[0] |
| 2657 | |
| 2658 | |
| 2659 | def add_all(*xs): |