@@ -64,7 +64,7 @@ def skipif_ci_apple(msg) -> Callable:
6464 return lambda x : x
6565
6666
67- def unit_test_going ():
67+ def unit_test_going () -> bool :
6868 """
6969 Enables a flag telling the script is running while testing it.
7070 Avois unit tests to be very long.
@@ -743,6 +743,13 @@ class ExtTestCase(unittest.TestCase):
743743 _warns : List [Tuple [str , int , Warning ]] = []
744744 _todos : List [Tuple [Callable , str ]] = []
745745
746+ def unit_test_going (self ):
747+ """
748+ Enables a flag telling the script is running while testing it.
749+ Avois unit tests to be very long.
750+ """
751+ return unit_test_going ()
752+
746753 @property
747754 def verbose (self ):
748755 "Returns the the value of environment variable ``VERBOSE``."
@@ -1238,7 +1245,7 @@ def assert_onnx_disc(
12381245 if isinstance (proto , str ):
12391246 name = proto
12401247 proto = onnx .load (name )
1241- else :
1248+ elif not self . unit_tst_going () :
12421249 assert isinstance (
12431250 proto , onnx .ModelProto
12441251 ), f"Unexpected type { type (proto )} for proto"
@@ -1309,7 +1316,7 @@ def assert_onnx_disc(
13091316 )
13101317 if verbose :
13111318 print (f"[{ vname } ] ep_expected { string_type (ep_expected , ** kws )} " )
1312- ep_diff = max_diff (expected , ep_expected )
1319+ ep_diff = max_diff (expected , ep_expected , hist = [ 0.1 , 0.01 ] )
13131320 if verbose :
13141321 print (f"[{ vname } ] ep_diff { string_diff (ep_diff )} " )
13151322 assert (
@@ -1323,11 +1330,11 @@ def assert_onnx_disc(
13231330 f"discrepancies in { test_name !r} between the model "
13241331 f"and the exported model diff={ string_diff (ep_diff )} "
13251332 )
1326- ep_nx_diff = max_diff (ep_expected , got , flatten = True )
1333+ ep_nx_diff = max_diff (ep_expected , got , flatten = True , hist = [ 0.1 , 0.01 ] )
13271334 if verbose :
13281335 print (f"[{ vname } ] ep_nx_diff { string_diff (ep_nx_diff )} " )
13291336
1330- diff = max_diff (expected , got , flatten = True )
1337+ diff = max_diff (expected , got , flatten = True , hist = [ 0.1 , 0.01 ] )
13311338 if verbose :
13321339 print (f"[{ vname } ] diff { string_diff (diff )} " )
13331340 assert (
0 commit comments