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

refactoring code with List Comprehension #15924

Merged
merged 2 commits into from
Jan 21, 2022
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
9 changes: 4 additions & 5 deletions keras/callbacks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,11 +1790,10 @@ def data_generator():

values = []
with open(fp) as f:
for x in csv.reader(f):
# In windows, due to \r\n line ends we may end up reading empty lines
# after each line. Skip empty lines.
if x:
values.append(x)
# On Windows, due to \r\n line ends, we may end up reading empty lines
# after each line. Skip empty lines.
values = [x for x in csv.reader(f) if x]

assert 'nan' in values[-1], 'The last epoch was not logged.'

@keras_parameterized.run_all_keras_modes(always_skip_v1=True)
Expand Down