MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / __init__

Method __init__

modules/networks.py:9–15  ·  view source on GitHub ↗
(self, in_channels, out_channels, bias=True)

Source from the content-addressed store, hash-verified

7
8class LinearDummy(torch.nn.Module):
9 def __init__(self, in_channels, out_channels, bias=True):
10 super().__init__()
11 self.out_channels = out_channels
12 self.weight = torch.nn.Parameter(torch.randn(out_channels, in_channels))
13 self.bias=None
14 if bias:
15 self.bias = torch.nn.Parameter(torch.zeros(out_channels))
16
17 def forward(self, x, gain=1):
18 return F.linear(x, self.weight, self.bias)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected