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

Fix load_dataset signature #1281

Closed

Conversation

louismartin
Copy link
Contributor

Fix for #1240
Tested with MaskedLMTask.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ngoyal2707 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 34e6a5e.

moussaKam pushed a commit to moussaKam/language-adaptive-pretraining that referenced this pull request Sep 29, 2020
Summary:
Fix for facebookresearch#1240
Tested with MaskedLMTask.
Pull Request resolved: facebookresearch#1281

Differential Revision: D18051472

fbshipit-source-id: 0aeff60c71489655f5e621349f780ba9cd8c027a
facebook-github-bot pushed a commit that referenced this pull request Nov 16, 2020
Summary:
Pull Request resolved: fairinternal/fairseq-py#1281

The PyTorch Mobile lite interpreter does not support NamedTuple creation in forward. One workaround is to replace NamedTuple with a custom class that inherits nn.Module. This class could be initialized in `__init__` and updated in forward. However, lite interpreter does not support list construction with custom classes. So the final solution is to replace the NamedTuple with a dictionary. We cannot have mixed value types in that dictionary, otherwise, this breaks TorchScript export. So the type is List[Tensor] and an empty list corresponds to having a value of None.

Reviewed By: myleott

Differential Revision: D23752010

fbshipit-source-id: 0b152a534a165ce4f84bd4f580d7f29145cfd264
yzpang pushed a commit to yzpang/gold-off-policy-text-gen-iclr21 that referenced this pull request Feb 19, 2021
Summary:
Fix for facebookresearch/fairseq#1240
Tested with MaskedLMTask.
Pull Request resolved: facebookresearch/fairseq#1281

Differential Revision: D18051472

fbshipit-source-id: 0aeff60c71489655f5e621349f780ba9cd8c027a
yzpang pushed a commit to yzpang/gold-off-policy-text-gen-iclr21 that referenced this pull request Feb 19, 2021
Summary:
Fix for facebookresearch/fairseq#1240
Tested with MaskedLMTask.
Pull Request resolved: facebookresearch/fairseq#1281

Differential Revision: D18051472

fbshipit-source-id: 0aeff60c71489655f5e621349f780ba9cd8c027a
sshleifer pushed a commit that referenced this pull request Apr 7, 2021
Summary:
Pull Request resolved: fairinternal/fairseq-py#1281

The PyTorch Mobile lite interpreter does not support NamedTuple creation in forward. One workaround is to replace NamedTuple with a custom class that inherits nn.Module. This class could be initialized in `__init__` and updated in forward. However, lite interpreter does not support list construction with custom classes. So the final solution is to replace the NamedTuple with a dictionary. We cannot have mixed value types in that dictionary, otherwise, this breaks TorchScript export. So the type is List[Tensor] and an empty list corresponds to having a value of None.

Reviewed By: myleott

Differential Revision: D23752010

fbshipit-source-id: 0b152a534a165ce4f84bd4f580d7f29145cfd264
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants