Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Make replace_masked_values more efficient by using masked_fill #1651

Merged
merged 1 commit into from Aug 23, 2018

Conversation

matt-gardner
Copy link
Contributor

Fixes #1039. This has been bugging me for a while, and seeing it being used in #1625 made me want to just fix it. This should make any use of this code with large tensors a good deal more efficient, too, as it uses far fewer intermediate operations.

Copy link
Contributor

@DeNeutoy DeNeutoy left a comment

Choose a reason for hiding this comment

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

LGTM

@matt-gardner matt-gardner merged commit d27770a into allenai:master Aug 23, 2018
@matt-gardner matt-gardner deleted the use_masked_fill branch August 23, 2018 17:53
gabrielStanovsky pushed a commit to gabrielStanovsky/allennlp that referenced this pull request Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use masked_fill_ in replace_masked_values
2 participants