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

Method _check_gpu2cpu

dali/python/nvidia/dali/data_node.py:359–374  ·  view source on GitHub ↗

Checks whether using this `DataNode` in a CPU operator is legal. The function checks whether it's legal to pass it as an input to a CPU operator. If the node is a result of a GPU operator which belongs to a pipeline with non-dynamic executor, an error is raised. ..

(self)

Source from the content-addressed store, hash-verified

357 return self.property("source_info", device=device)
358
359 def _check_gpu2cpu(self):
360 """Checks whether using this `DataNode` in a CPU operator is legal.
361
362 The function checks whether it's legal to pass it as an input to a CPU operator.
363 If the node is a result of a GPU operator which belongs to a pipeline with non-dynamic
364 executor, an error is raised.
365
366 .. note::
367 If the defining operator does not yet belong to any pipeline, the error is not raised and
368 the check is deferred until `Pipeline.build`.
369 """
370 if self.device == "gpu" and self.source and self.source.pipeline:
371 self.source.pipeline._require_exec_dynamic(
372 "This pipeline doesn't support transition from GPU to CPU.\n"
373 "GPU->CPU transitions require "
374 )
375
376
377not_iterable(DataNode)

Callers 3

cpuMethod · 0.95
shapeMethod · 0.95
propertyMethod · 0.95

Calls 1

_require_exec_dynamicMethod · 0.80

Tested by

no test coverage detected