Returns the tensor on the GPU. If it's already there, this function returns `self`. If index is not specified, the current CUDA device is used.
(self, index: int | None = None)
| 361 | return self.to_device(Device.CPU) |
| 362 | |
| 363 | def gpu(self, index: int | None = None) -> "Tensor": |
| 364 | """ |
| 365 | Returns the tensor on the GPU. If it's already there, this function returns `self`. |
| 366 | |
| 367 | If index is not specified, the current CUDA device is used. |
| 368 | """ |
| 369 | return self.to_device(Device("gpu", index)) |
| 370 | |
| 371 | @property |
| 372 | def device(self) -> Device: |