| 30 | |
| 31 | template <int N> |
| 32 | void* tensor2memref_dim(const megdnn::TensorND& tensor) { |
| 33 | switch (tensor.layout.dtype.enumv()) { |
| 34 | #define cb(_dtype, _type) \ |
| 35 | case megdnn::DTypeEnum::_dtype: \ |
| 36 | return get_strided_memref_type<_type, N>(tensor); |
| 37 | FOR_EACH_DNN_DTYPE(cb) |
| 38 | #undef cb |
| 39 | default: |
| 40 | mgb_throw( |
| 41 | InternalError, "Unsupported dtype: %s", tensor.layout.dtype.name()); |
| 42 | } |
| 43 | return nullptr; |
| 44 | } |
| 45 | |
| 46 | void* tensor2memref(const megdnn::TensorND& tensor) { |
| 47 | switch (tensor.layout.ndim) { |