MCPcopy Create free account
hub / github.com/MegEngine/MegCC / tensor2TinyMat

Function tensor2TinyMat

compiler/test/kernel/common/src/cc_proxy_cv.cpp:190–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188};
189
190static inline TinyMat tensor2TinyMat(const megdnn::TensorND& tensor) {
191 auto layout = tensor.layout;
192 mgb_assert(
193 layout.ndim == 3 || ((layout.ndim == 4) && (layout[0] == 1)),
194 "failed %s, %d %d", layout.to_string().c_str(), (layout.ndim == 4),
195 (layout[0] == 1));
196 int idx_offset = layout.ndim - 3;
197 TinyMat res;
198 res.rows = layout[idx_offset + 0];
199 res.cols = layout[idx_offset + 1];
200 res.channels = layout[idx_offset + 2];
201 res.data = tensor.raw_ptr();
202 return res;
203}
204template <typename Opr>
205PerformanceResult proxy_cv_kernel(
206 TensorNDArray tensor_array, RunCvHelper<Opr>& runner, void* func_ptr,

Callers 1

proxy_cv_kernelFunction · 0.85

Calls 1

to_stringMethod · 0.45

Tested by

no test coverage detected