fairseq
fairseq copied to clipboard
Fix tlayer torch JIT export
Fix tlayer torch JIT export exception: "Could not cast value of type NoneType to bool" When torch jit exporting, self.need_attn is None. Fix #4459
Before submitting
- [ ] Was this discussed/approved via a Github issue? (no need for typos, doc improvements): Issue created 1 month ago, no comment.
- [X] Did you read the contributor guideline?
- [ ] Did you make sure to update the docs?
- [ ] Did you write any new necessary tests? I will if anyone comments/considers it necessary
What does this PR do?
Fixes #4459.
PR review
Anyone in the community is free to review the PR once the tests have passed. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. I ve created the Github issue 1 month ago, no comment as today: #4459
Did you have fun?
not yet