Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle arguments more strictly #5340

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dali/python/nvidia/dali/plugin/base_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class _DaliBaseIterator(object):
* ``"no"``, ``False`` or ``None`` - at the end of epoch StopIteration is raised and
reset() needs to be called. Calling ``iter()`` on the iterator would reset
it as well.
* ``"yes"`` or ``"True"``- at the end of epoch StopIteration is raised but reset()
* ``"yes"`` or ``True``- at the end of epoch StopIteration is raised but reset()
is called internally automatically

fill_last_batch : bool, optional, default = None
Expand Down Expand Up @@ -162,9 +162,9 @@ def __init__(
), "All pipelines should have the same batch size set"

self._size = int(size)
if not auto_reset or auto_reset is None or auto_reset == "no":
if auto_reset is False or auto_reset is None or auto_reset == "no":
self._auto_reset = "no"
elif auto_reset or auto_reset == "yes":
elif auto_reset is True or auto_reset == "yes":
self._auto_reset = "yes"
else:
raise ValueError(f"Unsupported value for `auto_reset` {auto_reset}")
Expand Down