MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / tensor2memref_dim

Function tensor2memref_dim

src/jit/impl/mlir/executable_cpu.cpp:32–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31template <int N>
32void* 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
46void* tensor2memref(const megdnn::TensorND& tensor) {
47 switch (tensor.layout.ndim) {

Callers

nothing calls this directly

Calls 2

enumvMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected