Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ONNX] Create an
optimize
method in ONNXProgram (pytorch#137667)
Move optimization from the export call to the `optimize()` method in ONNXProgram. Users can call `optimize()` before calling `save()` to save the model. Right now if users set `optimize=True` in `torch.onnx.export` it will have the same effect as calling `optimize()`, but in the future we can evolve the method to be more flexible (e.g. target aware etc.) Example ```python onnx_program = torch.onnx.export(..., dynamo=True) onnx_program.optimize() onnx_program.save("model.onnx") ``` Pull Request resolved: pytorch#137667 Approved by: https://github.com/titaiwangms ghstack dependencies: pytorch#137666
- Loading branch information