In longformer model, the original 'is_global_attn=None' can works, but when using torch.onnx.export() it will be failed when meet the below line if is_global_attn:
So I need to change it to explicitly checking like 'if is_global_attn == True:', also set the default value as False in signature 'is_global_attn=False'.
Before submitting
[ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
No, it is tiny code fix.
[ ] Was this discussed/approved via a Github issue or the forum? Please add a link
to it if that's the case.
No related issue. I try to convert the model to onnx but failed, so make some tiny change.
What does this PR do?
In longformer model, the original 'is_global_attn=None' can works, but when using torch.onnx.export() it will be failed when meet the below line
if is_global_attn:
So I need to change it to explicitly checking like 'if is_global_attn == True:', also set the default value as False in signature 'is_global_attn=False'.Before submitting
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.