MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / bottleneck

Method bottleneck

src/gopt/test/network.cpp:303–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303SymbolVar mgb::bottleneck(
304 Network& network, SymbolVar f, size_t input_channels, size_t channels, size_t t,
305 size_t stride, DType out_dtype) {
306 size_t in_channels = f.node()->shape()[1];
307 SymbolVar x = f;
308 if (t != 1) {
309 x = network.add_conv(
310 f, input_channels * t, {1, 1}, out_dtype, true, {1, 1}, {0, 0});
311 }
312 x = network.add_group_conv(
313 x, input_channels * t, input_channels * t, {3, 3}, out_dtype, true,
314 {stride, stride}, {1, 1});
315 x = network.add_conv(x, channels, {1, 1}, out_dtype, false, {1, 1}, {0, 0});
316 if (stride == 1 && in_channels == channels)
317 x = f + x;
318 return x;
319}
320
321SymbolVar mgb::bottleneck_group(
322 Network& network, SymbolVar f, size_t input_channels, size_t channels,

Callers

nothing calls this directly

Calls 4

add_convMethod · 0.80
add_group_convMethod · 0.80
shapeMethod · 0.45
nodeMethod · 0.45

Tested by

no test coverage detected