Sum true after mask

Hi guys,

x = torch.tensor([[1,2], [3, 4], [5, 6]]) 

I’m able to do the above but is there a way to do it just using torch?


The sum() method exists in torch. Simply removing the .numpy() will make it work.
Do you see an error when you do that?

Indeed it is. Thanks