MCPcopy
hub / github.com/NVlabs/imaginaire / conv

Function conv

imaginaire/third_party/flow_net/flownet2/networks/submodules.py:12–33  ·  view source on GitHub ↗
(use_batch_norm, in_planes, out_planes, kernel_size=3, stride=1)

Source from the content-addressed store, hash-verified

10
11
12def conv(use_batch_norm, in_planes, out_planes, kernel_size=3, stride=1):
13 if use_batch_norm:
14 return nn.Sequential(
15 nn.Conv2d(in_planes, out_planes, kernel_size=kernel_size,
16 stride=stride, padding=(kernel_size - 1) // 2,
17 bias=False),
18 nn.BatchNorm2d(out_planes),
19 nn.LeakyReLU(0.1, inplace=True)
20 )
21 else:
22 return nn.Sequential(
23 nn.Conv2d(
24 in_planes,
25 out_planes,
26 kernel_size=kernel_size,
27 stride=stride,
28 padding=(
29 kernel_size - 1) // 2,
30 bias=True),
31 nn.LeakyReLU(
32 0.1,
33 inplace=True))
34
35
36def i_conv(use_batch_norm, in_planes, out_planes, kernel_size=3, stride=1,

Callers 5

stemMethod · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected