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

Function convBlock

test/expr/ModuleTest.cpp:27–33  ·  view source on GitHub ↗

When we use MNNConverter to convert other mobilenet model to MNN model, {Conv3x3Depthwise + BN + Relu + Conv1x1 + BN + Relu} will be converted and optimized to {Conv3x3Depthwise + Conv1x1}

Source from the content-addressed store, hash-verified

25// {Conv3x3Depthwise + BN + Relu + Conv1x1 + BN + Relu} will be converted
26// and optimized to {Conv3x3Depthwise + Conv1x1}
27static VARP convBlock(VARP x, INTS channels, int stride) {
28 int inputChannel = channels[0], outputChannel = channels[1];
29 int group = inputChannel;
30 x = _Conv(0.01f, 0.0f, x, {inputChannel, inputChannel}, {3, 3}, SAME, {stride, stride}, {1, 1}, group);
31 x = _Conv(0.03f, 0.0f, x, {inputChannel, outputChannel}, {1, 1}, SAME, {1, 1}, {1, 1}, 1);
32 return x;
33}
34static VARP convBlocTemp(VARP x, INTS channels, int stride) {
35 int inputChannel = channels[0], outputChannel = channels[1];
36 int group = inputChannel;

Callers 2

_mobileNetV1ExprFunction · 0.70
_mobileNetV1ExprMethod · 0.70

Calls 1

_ConvFunction · 0.50

Tested by

no test coverage detected