MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / ConvBNReLU

Class ConvBNReLU

dmidas/backbones/next_vit.py:75–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73
74
75class ConvBNReLU(nn.Module):
76 def __init__(
77 self,
78 in_channels,
79 out_channels,
80 kernel_size,
81 stride,
82 groups=1):
83 super(ConvBNReLU, self).__init__()
84 self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=kernel_size, stride=stride,
85 padding=1, groups=groups, bias=False)
86 self.norm = nn.BatchNorm2d(out_channels, eps=NORM_EPS)
87 self.act = nn.ReLU(inplace=True)
88
89 def forward(self, x):
90 x = self.conv(x)
91 x = self.norm(x)
92 x = self.act(x)
93 return x
94
95
96def _make_divisible(v, divisor, min_value=None):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected