Skip to content

Commit 32d2c8b

Browse files
Add tolerance args to CheckONNXModel.py (#3024)
Signed-off-by: Alexandre Eichenberger <[email protected]>
1 parent 45f07d5 commit 32d2c8b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

utils/CheckONNXModel.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,13 @@ def valid_onnx_input(fname):
166166
" uint64, int64, float16, float32, float64",
167167
)
168168

169+
parser.add_argument(
170+
"--rtol", type=str, default="", help="Relative tolerance for verification."
171+
)
172+
parser.add_argument(
173+
"--atol", type=str, default="", help="Absolute tolerance for verification."
174+
)
175+
169176
args = parser.parse_args()
170177

171178
VERBOSE = os.environ.get("VERBOSE", False)
@@ -276,6 +283,10 @@ def main():
276283
# How to verify
277284
test_cmd += ["--verify=ref"]
278285
test_cmd += ["--verify-every-value"]
286+
if args.atol:
287+
test_cmd += ["--atol=" + args.atol]
288+
if args.rtol:
289+
test_cmd += ["--rtol=" + args.rtol]
279290
# Model name.
280291
test_cmd += [model_str]
281292

0 commit comments

Comments
 (0)