MCPcopy Create free account
hub / github.com/NVIDIA/DALI / dtype

Method dtype

dali/python/nvidia/dali/experimental/dynamic/_batch.py:493–506  ·  view source on GitHub ↗

The element type of the tensors in the batch.

(self)

Source from the content-addressed store, hash-verified

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:

Callers 3

PyArrayPayloadMethod · 0.45
PipelineMethod · 0.45

Calls 1

from_type_idMethod · 0.80

Tested by

no test coverage detected