| 82 | } |
| 83 | |
| 84 | static VARP bottleNeck(VARP x, INTS channels, int stride, int expansionRatio) { |
| 85 | int inputChannel = channels[0], outputChannel = channels[1]; |
| 86 | int expansionChannel = inputChannel * expansionRatio, group = expansionChannel; |
| 87 | auto y = _Conv(0.0f, 0.0f, x, {inputChannel, expansionChannel}, {1, 1}, VALID, {1, 1}, {1, 1}, 1); |
| 88 | y = _Conv(0.0f, 0.0f, y, {expansionChannel, expansionChannel}, {3, 3}, SAME, {stride, stride}, {1, 1}, group); |
| 89 | y = _Conv(0.0f, 0.0f, y, {expansionChannel, outputChannel}, {1, 1}, VALID, {1, 1}, {1, 1}, 1); |
| 90 | if (inputChannel != outputChannel || stride != 1) { |
| 91 | x = _Conv(0.0f, 0.0f, x, {inputChannel, outputChannel}, {1, 1}, SAME, {stride, stride}, {1, 1}, 1); |
| 92 | } |
| 93 | y = _Add(x, y); |
| 94 | return y; |
| 95 | } |
| 96 | |
| 97 | static VARP bottleNeckBlock(VARP x, INTS channels, int stride, int expansionRatio, int number) { |
| 98 | x = bottleNeck(x, {channels[0], channels[1]}, stride, expansionRatio); |
no test coverage detected