Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Fix invalid list comprehension #1343

Merged
merged 1 commit into from
Jan 8, 2019
Merged

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Jan 5, 2019

Fixes #1002 as the current code will raise NameError: name 'loss' is not defined at runtime.

python -c '[{"training": l} for l in loss for loss in "this is a test".split()]'    # error
python -c '[({"training": l} for l in loss) for loss in "this is a test".split()]'  # works

Fixes tensorflow#1002 as the current code will raise a NameError at runtime.
@googlebot googlebot added the cla: yes PR author has signed CLA label Jan 5, 2019
Copy link
Contributor

@lukaszkaiser lukaszkaiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lukaszkaiser lukaszkaiser merged commit cf1c451 into tensorflow:master Jan 8, 2019
@lukaszkaiser
Copy link
Contributor

Thanks for finding it and correcting!

@cclauss cclauss deleted the patch-3 branch January 8, 2019 19:23
tensorflow-copybara pushed a commit that referenced this pull request Jan 8, 2019
PiperOrigin-RevId: 228365154
kpe pushed a commit to kpe/tensor2tensor that referenced this pull request Mar 2, 2019
Fixes tensorflow#1002 as the current code will raise a NameError at runtime.
kpe pushed a commit to kpe/tensor2tensor that referenced this pull request Mar 2, 2019
PiperOrigin-RevId: 228365154
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has signed CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants