MCPcopy Create free account
hub / github.com/aigc3d/LHM / _ASPPModule

Class _ASPPModule

engine/BiRefNet/models/modules/aspp.py:11–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11class _ASPPModule(nn.Module):
12 def __init__(self, in_channels, planes, kernel_size, padding, dilation):
13 super(_ASPPModule, self).__init__()
14 self.atrous_conv = nn.Conv2d(
15 in_channels,
16 planes,
17 kernel_size=kernel_size,
18 stride=1,
19 padding=padding,
20 dilation=dilation,
21 bias=False,
22 )
23 self.bn = nn.BatchNorm2d(planes) if config.batch_size > 1 else nn.Identity()
24 self.relu = nn.ReLU(inplace=True)
25
26 def forward(self, x):
27 x = self.atrous_conv(x)
28 x = self.bn(x)
29
30 return self.relu(x)
31
32
33class ASPP(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected