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

Method device

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

The device on which the batch resides (or will reside, in case of lazy evaluation).

(self)

Source from the content-addressed store, hash-verified

507
508 @property
509 def device(self) -> Device:
510 """
511 The device on which the batch resides (or will reside, in case of lazy evaluation).
512 """
513 if self._device is None:
514 if self._invocation_result is not None:
515 self._device = self._invocation_result.device
516 elif self._tensors:
517 self._device = self._tensors[0].device
518 else:
519 raise ValueError("Cannot establish the number of dimensions of an empty Batch")
520 return self._device
521
522 @property
523 def layout(self) -> str | None:

Callers 3

__init__Method · 0.45
__init__Method · 0.45
_infer_output_devicesMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected