# tensorplay.cuda.memory_stats

Source: https://www.tensorplay.cn/docs/generated/tensorplay.cuda.memory_stats.html

# tensorplay.cuda.memory_stats

tensorplay.cuda.memory_stats(device: [Any](https://docs.python.org/3/library/typing.html#typing.Any) | [None](https://docs.python.org/3/library/constants.html#None) = None) &#x2192; [dict](https://docs.python.org/3/library/stdtypes.html#dict)[[str](https://docs.python.org/3/library/stdtypes.html#str), [Any](https://docs.python.org/3/library/typing.html#typing.Any)][[source]](../_modules/tensorplay/cuda/memory.html#memory_stats)

Return a dictionary of CUDA memory allocator statistics for a given device.

The return value of this function is a dictionary of statistics, each of
which is a non-negative integer. See torch.cuda.memory_stats() for
the full key layout; keys that are not tracked by this TensorPlay build
are always reported as zero.

Parameters:

device ([tensorplay.Device](tensorplay.Device.html#tensorplay.Device) or [int](https://docs.python.org/3/library/functions.html#int), optional) – selected device. Returns
statistics for the current device, given by
[current_device()](tensorplay.cuda.current_device.html#tensorplay.cuda.current_device), if [device](tensorplay.cuda.device.html#tensorplay.cuda.device) is
None (default).
