Skip to content

Commit

Permalink
Use public exec_dynamic property instead of the private field.
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
  • Loading branch information
mzient committed Nov 7, 2024
1 parent 90e3e20 commit 4f78784
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dali/python/nvidia/dali/data_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def _check_gpu2cpu(self):
the check is deferred until `Pipeline.build`.
"""
if self.device == "gpu" and self.source and self.source.pipeline:
if not self.source.pipeline._exec_dynamic:
if not self.source.pipeline.exec_dynamic:
raise RuntimeError(
"This pipeline doesn't support transition from GPU to CPU.\n"
'To enable GPU->CPU transitions, use the experimental "dynamic" executor.\n'
Expand Down
4 changes: 2 additions & 2 deletions dali/python/nvidia/dali/plugin/pytorch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def __next__(self) -> List[Dict[str, torch.Tensor]]:
data_batches = [None for i in range(self._num_gpus)]
for i in range(self._num_gpus):
dev_id = self._pipes[i].device_id
is_exec_dynamic = self._pipes[i]._exec_dynamic
is_exec_dynamic = self._pipes[i].exec_dynamic
# initialize dict for all output categories
category_outputs = dict()
# segregate outputs into categories
Expand Down Expand Up @@ -630,7 +630,7 @@ def __next__(self) -> List[Dict[str, torch.Tensor]]:
data_batches = [None for i in range(self._num_gpus)]
for i in range(self._num_gpus):
dev_id = self._pipes[i].device_id
is_exec_dynamic = self._pipes[i]._exec_dynamic
is_exec_dynamic = self._pipes[i].exec_dynamic
# initialize dict for all output categories
category_outputs = dict()
# segregate outputs into categories
Expand Down
4 changes: 2 additions & 2 deletions dali/python/nvidia/dali/plugin/tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def DALIIteratorWrapper(
cpu_prefetch_queue_depth = -1 # dummy: wont' be used
gpu_prefetch_queue_depth = prefetch_queue_depth

if pipeline is not None and pipeline._exec_dynamic:
if pipeline is not None and pipeline.exec_dynamic:
exec_dynamic = True

if serialized_pipeline is None:
Expand Down Expand Up @@ -451,7 +451,7 @@ def __init__(
output_shapes = self._handle_deprecation(output_shapes, shapes, "shapes")
output_dtypes = self._handle_deprecation(output_dtypes, dtypes, "dtypes")

if pipeline._exec_dynamic:
if pipeline.exec_dynamic:
exec_dynamic = True

if not self._check_dtypes(output_dtypes, tf.DType):
Expand Down

0 comments on commit 4f78784

Please sign in to comment.