[ONNX] Diagnostic option 'warnings_as_errors' (#105886)
If set, diagnostics with level as WARNING will be logged as level
with ERROR, and immediately raised.
TODO: bikeshed public export api.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/105886
Approved by: https://github.com/thiagocrepaldi