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

Method forward

intermediate_source/parametrizations.py:99–100  ·  view source on GitHub ↗
(self, X)

Source from the content-addressed store, hash-verified

97# The only thing that we have to do is to write the parametrization as a regular ``nn.Module``
98class Symmetric(nn.Module):
99 def forward(self, X):
100 return X.triu() + X.triu(1).transpose(-1, -2)
101
102###############################################################################
103# This is all we need to do. Once we have this, we can transform any regular layer into a

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected