Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
52
import
torch.nn.utils.parametrize
as
parametrize
53
54
def
symmetric(X):
55
return
X.triu() + X.triu(1).transpose(-1, -2)
56
57
X = torch.rand(3, 3)
58
A = symmetric(X)
Callers
2
parametrizations.py
File · 0.85
forward
Method · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected