oneflow.numel

oneflow.numel(input)int

Returns the total number of elements in the input tensor.

Parameters

input (oneflow.Tensor) – Input Tensor

>>> import oneflow as flow

>>> a = flow.randn(1, 2, 3, 4, 5)
>>> flow.numel(a)
120
>>> a = flow.zeros(4,4)
>>> flow.numel(a)
16