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

Method __init__

torchscript/modnet_torchscript.py:70–78  ·  view source on GitHub ↗
(self, in_channels, out_channels, reduction=1)

Source from the content-addressed store, hash-verified

68 """
69
70 def __init__(self, in_channels, out_channels, reduction=1):
71 super(SEBlock, self).__init__()
72 self.pool = nn.AdaptiveAvgPool2d(1)
73 self.fc = nn.Sequential(
74 nn.Linear(in_channels, int(in_channels // reduction), bias=False),
75 nn.ReLU(inplace=True),
76 nn.Linear(int(in_channels // reduction), out_channels, bias=False),
77 nn.Sigmoid()
78 )
79
80 def forward(self, x):
81 b, c, _, _ = x.size()

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected