used_mem_on_dev#
- ivy.used_mem_on_dev(device, /, *, process_specific=False)[source]#
Get the used memory (in GB) for a given device string. In case of CPU, the used RAM is returned.
- Parameters:
device (
Union
[Device
,NativeDevice
]) – The device string to convert to native device handle.process_specific (
bool
, default:False
) – Whether to check the memory used by this python process alone. Default is False.
- Return type:
float
- Returns:
ret – The used memory on the device in GB.
Examples
>>> x = ivy.used_mem_on_dev("cpu", process_specific = False) >>> print(x) 6.219563008
>>> x = ivy.used_mem_on_dev("cpu", process_specific = True) >>> print(x) 0.902400346
>>> y = ivy.used_mem_on_dev("gpu:0", process_specific = False) >>> print(y) 0.525205504