| 21 | } |
| 22 | |
| 23 | TensorLayout transposed_layout(const TensorLayout& layout) { |
| 24 | megdnn_assert(layout.ndim >= 2); |
| 25 | std::vector<size_t> permutation(layout.ndim); |
| 26 | std::iota(permutation.begin(), permutation.end(), 0); |
| 27 | std::iter_swap(permutation.rbegin(), permutation.rbegin() + 1); |
| 28 | return layout.dimshuffle(permutation); |
| 29 | } |
| 30 | |
| 31 | void transpose( |
| 32 | megdnn::cuda::HandleImpl* handle, const TensorND& src, const TensorND& dst) { |