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

Function get_mask_index

dnn/src/fallback/mask_conv/opr_impl.cpp:43–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41
42template <typename ctype>
43void get_mask_index(
44 const ctype* mask, const size_t OH, const size_t OW, unsigned int* maskInd,
45 size_t* maskN) {
46 size_t length = 0;
47 rep(oh, OH) rep(ow, OW) {
48 size_t idx = oh * OW + ow;
49 if (mask[idx]) {
50 maskInd[length++] = oh << 16 | ow;
51 }
52 }
53 *maskN = length;
54}
55
56void index_to_dst(
57 const float* result, float* dst, const size_t OC, const size_t OH,

Callers 1

exec_internelFunction · 0.85

Calls 1

repFunction · 0.70

Tested by

no test coverage detected