Fix different types in rsub caused bug#15707
Conversation
houseroad
left a comment
There was a problem hiding this comment.
Do we really need Linear and Sigmoid in this case?
|
@houseroad actually no, just copying my local testcase to it... It is fine if we only use a simple "1 - x' |
|
Yeah, let's do it to make it easier to understand. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@zrphercule has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@zrphercule has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
| self.run_model_test(model, train=True, input=c, batch_size=BATCH_SIZE) | ||
|
|
||
| def test_rsub(self): | ||
| class RsubMod(torch.nn.Module): |
There was a problem hiding this comment.
Just noticed other "Mod" does not mean "Model" but means "ExportMod"... I will change its name.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@zrphercule has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Before this pr, rsub did not convert two elements into the same dtype, therefore "1 - x" may export to an onnx model that two elements of rsub having different dtype. By adding this symbolic patch this bug should be fixed. Related test cases also created. Pull Request resolved: pytorch#15707 Differential Revision: D13583042 Pulled By: zrphercule fbshipit-source-id: 3a2de47a1a8d1ded1a0adfb911adbe6ac729cdef
Summary: Before this pr, rsub did not convert two elements into the same dtype, therefore "1 - x" may export to an onnx model that two elements of rsub having different dtype. By adding this symbolic patch this bug should be fixed. Related test cases also created. Pull Request resolved: pytorch#15707 Differential Revision: D13583042 Pulled By: zrphercule fbshipit-source-id: 3a2de47a1a8d1ded1a0adfb911adbe6ac729cdef
Before this pr, rsub did not convert two elements into the same dtype, therefore "1 - x" may export to an onnx model that two elements of rsub having different dtype.
By adding this symbolic patch this bug should be fixed.
Related test cases also created.