| 12 | using namespace cuda; |
| 13 | |
| 14 | TensorShape transposed_shape(const TensorShape& shape) { |
| 15 | SmallVector<size_t> tshape(shape.ndim); |
| 16 | for (size_t i = 0; i < shape.ndim; i++) { |
| 17 | tshape[i] = shape[i]; |
| 18 | } |
| 19 | std::iter_swap(tshape.rbegin(), tshape.rbegin() + 1); |
| 20 | return tshape; |
| 21 | } |
| 22 | |
| 23 | TensorLayout transposed_layout(const TensorLayout& layout) { |
| 24 | megdnn_assert(layout.ndim >= 2); |