| 506 | // Return the subtensor of a mode |
| 507 | template <int... Is, class Tensor> |
| 508 | CUTE_HOST_DEVICE constexpr |
| 509 | auto |
| 510 | tensor(Tensor&& tensor) |
| 511 | { |
| 512 | if constexpr (sizeof...(Is) == 0) { |
| 513 | return tensor; |
| 514 | } else { |
| 515 | return make_tensor(tensor.data(), get<Is...>(tensor.layout())); |
| 516 | } |
| 517 | |
| 518 | CUTE_GCC_UNREACHABLE; |
| 519 | } |
| 520 | |
| 521 | // Return the layout of a mode |
| 522 | template <int... Is, class Engine, class Layout> |
no test coverage detected