The element type of the tensors in the batch.
(self)
| 491 | |
| 492 | @property |
| 493 | def dtype(self) -> DType: |
| 494 | """ |
| 495 | The element type of the tensors in the batch. |
| 496 | """ |
| 497 | if self._dtype is None: |
| 498 | if self._storage is not None: |
| 499 | self._dtype = DType.from_type_id(self._storage.dtype) |
| 500 | elif self._invocation_result is not None: |
| 501 | self._dtype = _dtype(self._invocation_result.dtype) |
| 502 | elif self._tensors: |
| 503 | self._dtype = self._tensors[0].dtype |
| 504 | else: |
| 505 | raise ValueError("Cannot establish the number of dimensions of an empty Batch") |
| 506 | return self._dtype |
| 507 | |
| 508 | @property |
| 509 | def device(self) -> Device: |
no test coverage detected