MCPcopy Create free account
hub / github.com/pytorch/tutorials / __init__

Method __init__

intermediate_source/parametrizations.py:65–67  ·  view source on GitHub ↗
(self, n_features)

Source from the content-addressed store, hash-verified

63# We can then use this idea to implement a linear layer with symmetric weights
64class LinearSymmetric(nn.Module):
65 def __init__(self, n_features):
66 super().__init__()
67 self.weight = nn.Parameter(torch.rand(n_features, n_features))
68
69 def forward(self, x):
70 A = symmetric(self.weight)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected