torch.numel

J·2021년 6월 30일
0

pytorch

목록 보기
21/23

torch.numel(input)-> int

returns the total number of elements in the input tensor

input tensor의 원소의 개수를 반환한다.

  • example
>>> a = torch.randn(1, 2, 3, 4, 5)
>>> torch.numel(a)
120
>>> a = torch.zeros(4,4)
>>> torch.numel(a)
16
profile
I'm interested in processing video&images with deeplearning and solving problem in our lives.

0개의 댓글