# device

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

# device

class tensorplay.cuda.device(device: [Any](https://docs.python.org/3/library/typing.html#typing.Any))[[source]](../_modules/tensorplay/cuda.html#device)

Context-manager that changes the selected device.

Parameters:

device ([tensorplay.Device](tensorplay.Device.html#tensorplay.Device) or [int](https://docs.python.org/3/library/functions.html#int)) – device index to select. It’s a no-op if
this argument is a negative integer or None.
