From 50715e1973eb17d23cbb2e10fad465c0a31f8afa Mon Sep 17 00:00:00 2001 From: Janusz Lisiecki <39967756+JanuszL@users.noreply.github.com> Date: Thu, 6 Jun 2024 02:03:24 +0200 Subject: [PATCH] Add missing `blocking` argument documentation to the external source operator (#5501) - as the external source operator documentation is written in Python, it missed the `blocking` argument description which was defined in the native schema but not copied to the python description Signed-off-by: Janusz Lisiecki --- dali/pipeline/operator/builtin/input_operator.cc | 3 ++- dali/python/nvidia/dali/external_source.py | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dali/pipeline/operator/builtin/input_operator.cc b/dali/pipeline/operator/builtin/input_operator.cc index 67e2d19692..3f9b11eea6 100644 --- a/dali/pipeline/operator/builtin/input_operator.cc +++ b/dali/pipeline/operator/builtin/input_operator.cc @@ -23,7 +23,8 @@ A base for any operator that forwards in-memory data to DALI pipeline.)doc") .NumInput(0) .NumOutput(0) .AddOptionalArg("blocking", R"code( -If ``True``, this operator will block until the data is available (e.g. by calling ``feed_input``). +**Advanced** If ``True``, this operator will block until the data is available +(e.g. by calling ``feed_input``). If ``False``, the operator will raise an error, if the data is not available. )code", false) .AddOptionalArg("no_copy", R"code( diff --git a/dali/python/nvidia/dali/external_source.py b/dali/python/nvidia/dali/external_source.py index 7ce053ff0f..dead6f1321 100644 --- a/dali/python/nvidia/dali/external_source.py +++ b/dali/python/nvidia/dali/external_source.py @@ -460,6 +460,11 @@ class ExternalSource: .. note:: This is applicable only when copying data to and from GPU memory. + `blocking`: bool, optional + **Advanced** If True, this operator will block until the data is available + (e.g. by calling ``feed_input``). If False, the operator will raise an error, + if the data is not available. + `no_copy` : bool, optional Determines whether DALI should copy the buffer when feed_input is called. @@ -997,6 +1002,7 @@ def external_source( ndim=None, cuda_stream=None, use_copy_kernel=None, + blocking=None, batch=True, repeat_last=False, **kwargs, @@ -1068,6 +1074,7 @@ def _external_source( ) return op(name=name) + kwargs["blocking"] = blocking # Wrapper around external_source to switch between standard and debug mode. current_pipeline = _PipelineDebug.current() if getattr(current_pipeline, "_debug_on", False):