We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe4a1e8 commit c177daeCopy full SHA for c177dae
dali/python/nvidia/dali/experimental/dali2/_batch.py
@@ -18,7 +18,6 @@
18
Tensor,
19
_is_full_slice,
20
_try_convert_enums,
21
- _backend_device,
22
tensor as _tensor,
23
as_tensor as _as_tensor,
24
)
@@ -29,6 +28,13 @@
29
28
from . import _invocation
30
import nvtx
31
+def _backend_device(backend: Union[_backend.TensorListCPU, _backend.TensorListGPU]) -> Device:
32
+ if isinstance(backend, _backend.TensorListCPU):
33
+ return Device("cpu")
34
+ elif isinstance(backend, _backend.TensorListGPU):
35
+ return Device("gpu", backend.device_id())
36
+ else:
37
+ raise ValueError(f"Unsupported backend type: {type(backend)}")
38
39
def _is_tensor_type(x):
40
from . import _batch
0 commit comments