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

Change max to abs for preprocess time #240

Merged
merged 1 commit into from
Oct 30, 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 dlio_benchmark/reader/reader_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def __init__(self, dataset_type, thread_index):

@dlp.log
def preprocess(self, a=None):
if self._args.preprocess_time != 0. or self._args.preprocess_time_stdev != 0.:
if self._args.preprocess_time > 0. or self._args.preprocess_time_stdev > 0.:
t = np.random.normal(self._args.preprocess_time, self._args.preprocess_time_stdev)
sleep(max(t, 0.0))
sleep(abs(t))
return a
@abstractmethod
def open(self, filename):
Expand Down Expand Up @@ -151,4 +151,4 @@ def is_index_based(self):

@abstractmethod
def is_iterator_based(self):
return False
return False
Loading