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

Function rep

dnn/src/naive/gaussian_blur/opr_impl.cpp:100–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99 FixedPtCastEx<int, uint8_t> cast_op(2 * bits);
100 rep(n, N) rep(h, IH) rep(w, IW) rep(c, IC) {
101 int val = 0;
102 rep(iy, kernel_height) {
103 int y = gaussian_blur::border_interpolate(
104 h + iy - kernel_height / 2, IH, param().border_mode);
105 rep(ix, kernel_width) {
106 int x = gaussian_blur::border_interpolate(
107 w + ix - kernel_width / 2, IW, param().border_mode);
108
109 //! BORDER_CONSTANT or BORDER_TRANSPARENT
110 if (x != -1 && y != -1) {
111 val += kx.at(0, ix, 0) * ky.at(0, iy, 0) *
112 src.ptr<uint8_t>()
113 [n * src.layout.stride[0] +
114 y * src.layout.stride[1] +
115 x * src.layout.stride[2] +
116 c * src.layout.stride[3]];
117 }
118 }
119 }
120 dst.ptr<uint8_t>()
121 [n * dst.layout.stride[0] + h * dst.layout.stride[1] +
122 w * dst.layout.stride[2] + c * dst.layout.stride[3]] = cast_op(val);
123 }
124}
125
126template <typename T>

Callers 2

exec_internalMethod · 0.70

Calls 3

border_interpolateFunction · 0.50
paramFunction · 0.50
atMethod · 0.45

Tested by

no test coverage detected