| 36 | } |
| 37 | |
| 38 | static 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 | |
| 50 | static VARP bottleNeckBlock(VARP x, INTS channels, int stride, int number) { |
| 51 | x = bottleNeck(x, {channels[0], channels[1], channels[2]}, stride); |
no test coverage detected