From 213f4f30e77a1f121cc886d6593a4de9805dc063 Mon Sep 17 00:00:00 2001 From: Alexandre Eichenberger Date: Thu, 5 Dec 2024 10:29:06 -0500 Subject: [PATCH] Add tolerance args to CheckONNXModel.py Signed-off-by: Alexandre Eichenberger --- utils/CheckONNXModel.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/utils/CheckONNXModel.py b/utils/CheckONNXModel.py index 7b90165de9..db4ebd49ca 100755 --- a/utils/CheckONNXModel.py +++ b/utils/CheckONNXModel.py @@ -166,6 +166,13 @@ def valid_onnx_input(fname): " uint64, int64, float16, float32, float64", ) +parser.add_argument( + "--rtol", type=str, default="", help="Relative tolerance for verification." +) +parser.add_argument( + "--atol", type=str, default="", help="Absolute tolerance for verification." +) + args = parser.parse_args() VERBOSE = os.environ.get("VERBOSE", False) @@ -276,6 +283,10 @@ def main(): # How to verify test_cmd += ["--verify=ref"] test_cmd += ["--verify-every-value"] + if args.atol: + test_cmd += ["--atol=" + args.atol] + if args.rtol: + test_cmd += ["--rtol=" + args.rtol] # Model name. test_cmd += [model_str]