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

Function symmetric

intermediate_source/parametrizations.py:54–55  ·  view source on GitHub ↗
(X)

Source from the content-addressed store, hash-verified

52import torch.nn.utils.parametrize as parametrize
53
54def symmetric(X):
55 return X.triu() + X.triu(1).transpose(-1, -2)
56
57X = torch.rand(3, 3)
58A = symmetric(X)

Callers 2

forwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected