[ONNX] fix provider_version and add consistency test (#36797)
Summary:
forward port the test from pr gh-36795, xref issue gh-32561
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36797
Differential Revision: D21257034
Pulled By: ezyang
fbshipit-source-id: d217da0e74f00a433c904defc0bf3eb5f594fd5e