MCPcopy Create free account
hub / github.com/alibaba/MNN / bottleNeck

Function bottleNeck

benchmark/exprModels/ResNetExpr.cpp:38–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38static VARP bottleNeck(VARP x, INTS channels, int stride) {
39 int inputChannel = x->getInfo()->dim[1], narrowChannel = channels[1], outputChannel = channels[2];
40 auto y = _Conv(0.0f, 0.0f, x, {inputChannel, narrowChannel}, {1, 1}, SAME, {stride, stride}, {1, 1}, 1);
41 y = _Conv(0.0f, 0.0f, y, {narrowChannel, narrowChannel}, {3, 3}, SAME, {1, 1}, {1, 1}, 1);
42 y = _Conv(0.0f, 0.0f, y, {narrowChannel, outputChannel}, {1, 1}, VALID, {1, 1}, {1, 1}, 1);
43 if (inputChannel != outputChannel || stride != 1) {
44 x = _Conv(0.0f, 0.0f, x, {inputChannel, outputChannel}, {1, 1}, SAME, {stride, stride}, {1, 1}, 1);
45 }
46 y = _Add(x, y);
47 return y;
48}
49
50static VARP bottleNeckBlock(VARP x, INTS channels, int stride, int number) {
51 x = bottleNeck(x, {channels[0], channels[1], channels[2]}, stride);

Callers 1

bottleNeckBlockFunction · 0.70

Calls 3

_AddFunction · 0.85
_ConvFunction · 0.50
getInfoMethod · 0.45

Tested by

no test coverage detected