0

I have a symmetric matrix and I want to loop over its elements. Currently, I'm using:
import torch
# sample symmetric matrix
W = torch.tensor([[0., 3., 0., 0., 0., 0., 0., 0., 0.],
[3., 0., 1., 0., 0., 0., 0., 0., 0.],
[0., 1., 0., 1., 1., 0., 0., 0., 0.],
[0., 0., 1., 0...