Skip to content

Commit

Permalink
Add tolerance args to CheckONNXModel.py
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Eichenberger <alexe@us.ibm.com>
  • Loading branch information
AlexandreEichenberger committed Dec 5, 2024
1 parent e801b36 commit 213f4f3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions utils/CheckONNXModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]

Expand Down

0 comments on commit 213f4f3

Please sign in to comment.