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

Function convBlock

benchmark/exprModels/MobileNetExpr.cpp:19–25  ·  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

17// {Conv3x3Depthwise + BN + Relu + Conv1x1 + BN + Relu} will be converted
18// and optimized to {Conv3x3Depthwise + Conv1x1}
19static VARP convBlock(VARP x, INTS channels, int stride) {
20 int inputChannel = channels[0], outputChannel = channels[1];
21 int group = inputChannel;
22 x = _Conv(0.0f, 0.0f, x, {inputChannel, inputChannel}, {3, 3}, SAME, {stride, stride}, {1, 1}, group);
23 x = _Conv(0.0f, 0.0f, x, {inputChannel, outputChannel}, {1, 1}, SAME, {1, 1}, {1, 1}, 1);
24 return x;
25}
26
27VARP mobileNetV1Expr(MobileNetWidthType alpha, MobileNetResolutionType beta, int numClass) {
28 int inputSize, poolSize; // MobileNet_224, MobileNet_192, MobileNet_160, MobileNet_128

Callers 1

mobileNetV1ExprFunction · 0.70

Calls 1

_ConvFunction · 0.50

Tested by

no test coverage detected