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

Function FOR3

src/opr/test/dnn/convolution.cpp:73–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 float scale = *(dptr++);
72
73 FOR3(ocg, OCPG, fh, FH, fw, FW) {
74 auto oc_tot = group * OCPG + ocg;
75 int oh = int(ih * param.stride_h + fh * param.dilate_h) - int(param.pad_h),
76 ow = int(iw * param.stride_w + fw * param.dilate_w) - int(param.pad_w);
77 if (oh >= 0 && ow >= 0 && oh < static_cast<int>(OH) &&
78 ow < static_cast<int>(OW)) {
79 auto out_off = n * ol.stride[0] + oc_tot * ol.stride[1] +
80 oh * ol.stride[2] + ow;
81 size_t flt_off = 0;
82 if (param.sparse == Param::Convolution::Sparse::DENSE) {
83 flt_off = icg * fl.stride[0] + ocg * fl.stride[1] +
84 fh * fl.stride[2] + fw;
85 } else {
86 flt_off = group * fl.stride[0] + icg * fl.stride[1] +
87 ocg * fl.stride[2] + fh * fl.stride[3] + fw;
88 }
89 optr[out_off] += scale * fptr[flt_off];
90 }
91 }
92 }
93#undef FOR3
94#undef FOR2

Callers 2

conv_bwd_data_bruteFunction · 0.85
TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected