Device type and device ID for where the data in the buffer resides. Uses device type codes matching DLPack. Note: must be implemented even if ``__dlpack__`` is not.
(self)
| 83 | raise NotImplementedError("__dlpack__") |
| 84 | |
| 85 | def __dlpack_device__(self) -> tuple[DlpackDeviceType, int | None]: |
| 86 | """ |
| 87 | Device type and device ID for where the data in the buffer resides. |
| 88 | Uses device type codes matching DLPack. |
| 89 | Note: must be implemented even if ``__dlpack__`` is not. |
| 90 | """ |
| 91 | if self._x.is_cpu: |
| 92 | return (DlpackDeviceType.CPU, None) |
| 93 | else: |
| 94 | raise NotImplementedError("__dlpack_device__") |
| 95 | |
| 96 | def __repr__(self) -> str: |
| 97 | return ( |
no outgoing calls