[ONNX] Replace optional parameters of Resize with placeholder for ops13.#50574
[ONNX] Replace optional parameters of Resize with placeholder for ops13.#50574neginraoof merged 6 commits intopytorch:onnx_ms_1from fatcat-z:onnx_ops13_resize
Conversation
jiafatom
left a comment
There was a problem hiding this comment.
Can we reuse the logic from Resize-11 exporter? The onnx spec change only affects the input to optional, code logic seems to be reusable.
Yes, the logic is same. Changing the dummy data used in Resize-11 exporter to place holder in Resize-13 is aimed to reduce the final ONNX file size. Place holder will cause an empty for the optional parameter while dummy data will still occupy some room iu the ONNX file. |
Sorry for confusion. My point is that can we reuse the common code to avoid code duplication? Put the common code into |
Got it, yes it makes sense. Working on it. |
neginraoof
left a comment
There was a problem hiding this comment.
Overall looks good. Left a couple minor comments.
…13. (#50574) * Replace optional parameters of Resize with placeholder for ops13. * Use common methods to handle different versions. * Correct flake8 issue. * Update per comments. * Add something to trigger CI again. * Trigger another round of CI. [ghstack-poisoned]
…der for ops13. (#50574)" * Replace optional parameters of Resize with placeholder for ops13. * Use common methods to handle different versions. * Correct flake8 issue. * Update per comments. * Add something to trigger CI again. * Trigger another round of CI. Differential Revision: [D26023939](https://our.internmc.facebook.com/intern/diff/D26023939) [ghstack-poisoned]
…der for ops13. (#50574)" * Replace optional parameters of Resize with placeholder for ops13. * Use common methods to handle different versions. * Correct flake8 issue. * Update per comments. * Add something to trigger CI again. * Trigger another round of CI. [ghstack-poisoned]
…der for ops13. (#50574)" * Replace optional parameters of Resize with placeholder for ops13. * Use common methods to handle different versions. * Correct flake8 issue. * Update per comments. * Add something to trigger CI again. * Trigger another round of CI. Differential Revision: [D26050882](https://our.internmc.facebook.com/intern/diff/D26050882) [ghstack-poisoned]
…der for ops13. (#50574)" * Replace optional parameters of Resize with placeholder for ops13. * Use common methods to handle different versions. * Correct flake8 issue. * Update per comments. * Add something to trigger CI again. * Trigger another round of CI. Differential Revision: [D26050882](https://our.internmc.facebook.com/intern/diff/D26050882) [ghstack-poisoned]
…13. (#50574) (#50954) Summary: Pull Request resolved: #50954 * Replace optional parameters of Resize with placeholder for ops13. * Use common methods to handle different versions. * Correct flake8 issue. * Update per comments. * Add something to trigger CI again. * Trigger another round of CI. Test Plan: Imported from OSS Reviewed By: pbelevich Differential Revision: D26050882 Pulled By: SplitInfinity fbshipit-source-id: aea6205a1ba4a0621fe1ac9e0c7d94b92b6d8f21
…13. (pytorch#50574) * Replace optional parameters of Resize with placeholder for ops13. * Use common methods to handle different versions. * Correct flake8 issue. * Update per comments. * Add something to trigger CI again. * Trigger another round of CI. ghstack-source-id: e57846f Pull Request resolved: pytorch#50954
ONNX models generated from PyTorch targeting ONNX opset < 13 use empty tensors to represent omitted optional inputs in the Resize operator, rather than setting the input name to an empty string. See pytorch/pytorch#50574.
ONNX models generated from PyTorch targeting ONNX opset < 13 use empty tensors to represent omitted optional inputs in the Resize operator, rather than setting the input name to an empty string. See pytorch/pytorch#50574.
Replace optional parameters of Resize with placeholder for ops13.