# device_of Source: https://www.tensorplay.cn/docs/generated/tensorplay.cuda.device_of.html ```python class tensorplay.cuda.device_of(obj) ``` Context-manager that changes the current device to that of given object. You can use both tensors and storages as arguments. If a given object is not allocated on a GPU, this is a no-op. Parameters: obj ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor) or Storage) – object allocated on the selected device.