torch.numel() - beyondnlp/nlp GitHub Wiki
https://pytorch.org/docs/stable/generated/torch.numel.html
>>> a = torch.randn(1, 2, 3, 4, 5)
>>> torch.numel(a)
120
>>> a = torch.zeros(4,4)
>>> torch.numel(a)
16
https://pytorch.org/docs/stable/generated/torch.numel.html
>>> a = torch.randn(1, 2, 3, 4, 5)
>>> torch.numel(a)
120
>>> a = torch.zeros(4,4)
>>> torch.numel(a)
16