Fix different types in rsub caused bug (#15707)
authorzrphercule <zrphercule@gmail.com>
Sat, 5 Jan 2019 00:11:23 +0000 (16:11 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 5 Jan 2019 00:14:13 +0000 (16:14 -0800)
commit3d44eeec0a31334e7642b4251da151733ec9fb69
tree5f0ff9675b6e7b51e033c6ddc09fc9e7d5fba3c1
parentae91156e5dcda265f797606bc2e1fa0e46b29d1d
Fix different types in rsub caused bug (#15707)

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: https://github.com/pytorch/pytorch/pull/15707

Differential Revision: D13583042

Pulled By: zrphercule

fbshipit-source-id: 3a2de47a1a8d1ded1a0adfb911adbe6ac729cdef
test/onnx/expect/TestOperators.test_rsub.expect
test/onnx/test_pytorch_onnx_caffe2.py
torch/onnx/symbolic.py