From 4f78784d89c9a0b9bd376e3ae1739ce070793dcb Mon Sep 17 00:00:00 2001 From: Michal Zientkiewicz Date: Wed, 6 Nov 2024 15:05:43 +0100 Subject: [PATCH] Use public exec_dynamic property instead of the private field. Signed-off-by: Michal Zientkiewicz --- dali/python/nvidia/dali/data_node.py | 2 +- dali/python/nvidia/dali/plugin/pytorch/__init__.py | 4 ++-- dali/python/nvidia/dali/plugin/tf.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dali/python/nvidia/dali/data_node.py b/dali/python/nvidia/dali/data_node.py index a954c672f4..180781c264 100644 --- a/dali/python/nvidia/dali/data_node.py +++ b/dali/python/nvidia/dali/data_node.py @@ -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' diff --git a/dali/python/nvidia/dali/plugin/pytorch/__init__.py b/dali/python/nvidia/dali/plugin/pytorch/__init__.py index aa9e3748c2..510759abc9 100644 --- a/dali/python/nvidia/dali/plugin/pytorch/__init__.py +++ b/dali/python/nvidia/dali/plugin/pytorch/__init__.py @@ -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 @@ -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 diff --git a/dali/python/nvidia/dali/plugin/tf.py b/dali/python/nvidia/dali/plugin/tf.py index 28260bf329..4a9fb3a66d 100644 --- a/dali/python/nvidia/dali/plugin/tf.py +++ b/dali/python/nvidia/dali/plugin/tf.py @@ -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: @@ -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):