Skip to content

Commit

Permalink
Add missing blocking argument documentation to the external source …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
JanuszL committed Jun 6, 2024
1 parent 750b90e commit 50715e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dali/pipeline/operator/builtin/input_operator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
7 changes: 7 additions & 0 deletions dali/python/nvidia/dali/external_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -997,6 +1002,7 @@ def external_source(
ndim=None,
cuda_stream=None,
use_copy_kernel=None,
blocking=None,
batch=True,
repeat_last=False,
**kwargs,
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 50715e1

Please sign in to comment.