Commit 7227655
Merge input and output shape when removing identity (#2588)
Similar with #2578, for this case:
```python
import torch
import torch.nn as nn
class Model(nn.Module):
def forward(self, x):
return x.new_zeros(x.shape)
def main():
model = Model()
args = torch.rand(4, 4),
batch = torch.export.Dim("batch")
dynamic_shapes = {"x": {0: batch}}
torch.onnx.export(
model,
args,
"model_test.onnx",
dynamic_shapes=dynamic_shapes,
dynamo=True,
)
if __name__ == "__main__":
main()
```
---------
Co-authored-by: Justin Chu <[email protected]>1 parent 9b54ad5 commit 7227655
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
611 | 614 | | |
612 | 615 | | |
613 | 616 | | |
| |||
0 commit comments