num_ivy_arrays_on_dev#
- ivy.num_ivy_arrays_on_dev(device, /)[source]#
Return the number of arrays which are currently alive on the specified device.
- Parameters:
device (
Union
[Device
,NativeDevice
]) – The device handle from which to count the arrays- Return type:
int
- Returns:
ret – Number of arrays on the specified device
Examples
>>> x1 = ivy.array([-1, 0, 5.2]) >>> x2 = ivy.array([-1, 0, 5.2, 4, 5]) >>> y = ivy.num_ivy_arrays_on_dev(ivy.default_device()) >>> print(y) 2
>>> x1 = ivy.native_array([-1, 0, 5.2]) >>> y = ivy.num_ivy_arrays_on_dev(ivy.default_device()) >>> print(y) 0
>>> x = ivy.Container(x1=ivy.array([-1]), ... x2=ivy.native_array([-1])) >>> y = ivy.num_ivy_arrays_on_dev(ivy.default_device()) >>> print(y) 1