MCPcopy Create free account
hub / github.com/ZHKKKe/MODNet / __init__

Method __init__

torchscript/modnet_torchscript.py:24–31  ·  view source on GitHub ↗
(self, in_channels)

Source from the content-addressed store, hash-verified

22 """
23
24 def __init__(self, in_channels):
25 super(IBNorm, self).__init__()
26 in_channels = in_channels
27 self.bnorm_channels = int(in_channels / 2)
28 self.inorm_channels = in_channels - self.bnorm_channels
29
30 self.bnorm = nn.BatchNorm2d(self.bnorm_channels, affine=True)
31 self.inorm = nn.InstanceNorm2d(self.inorm_channels, affine=False)
32
33 def forward(self, x):
34 bn_x = self.bnorm(x[:, :self.bnorm_channels, ...].contiguous())

Callers 6

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected