Commit 1544ee1
authored
[torchlib] Do not register rsub (#1907)
Remove rsub since it is handled by decomp, and torch doesn't have a type
promotion rule for rsub so we use sub instead.
Tested with
```python
import torch
class Model(torch.nn.Module):
def forward(self, x):
return 1 - x
ep = torch.export.export(Model(), (torch.tensor(1),))
print(ep)
program = torch.onnx.export(Model(), (torch.tensor(1),), dynamo=True)
print(program)
```1 parent a4f3bcb commit 1544ee1
File tree
2 files changed
+2
-11
lines changed- onnxscript/function_libs/torch_lib/ops
- tests/function_libs/torch_lib
2 files changed
+2
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7352 | 7352 | | |
7353 | 7353 | | |
7354 | 7354 | | |
7355 | | - | |
| 7355 | + | |
7356 | 7356 | | |
7357 | 7357 | | |
7358 | 7358 | | |
7359 | | - | |
7360 | | - | |
7361 | | - | |
7362 | | - | |
7363 | | - | |
7364 | | - | |
7365 | | - | |
7366 | | - | |
| 7359 | + | |
7367 | 7360 | | |
7368 | 7361 | | |
7369 | 7362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1360 | 1360 | | |
1361 | 1361 | | |
1362 | 1362 | | |
1363 | | - | |
1364 | | - | |
1365 | 1363 | | |
1366 | 1364 | | |
1367 | 1365 | | |
| |||
0 commit comments