@@ -149,7 +149,7 @@ def _assert_expected(output, name, prec=None, atol=None, rtol=None):
149
149
if binary_size > MAX_PICKLE_SIZE :
150
150
raise RuntimeError (f"The output for { filename } , is larger than 50kb - got { binary_size } kb" )
151
151
else :
152
- expected = torch .load (expected_file )
152
+ expected = torch .load (expected_file , weights_only = True )
153
153
rtol = rtol or prec # keeping prec param for legacy reason, but could be removed ideally
154
154
atol = atol or prec
155
155
torch .testing .assert_close (output , expected , rtol = rtol , atol = atol , check_dtype = False , check_device = False )
@@ -747,7 +747,7 @@ def check_out(out):
747
747
# so instead of validating the probability scores, check that the class
748
748
# predictions match.
749
749
expected_file = _get_expected_file (model_name )
750
- expected = torch .load (expected_file )
750
+ expected = torch .load (expected_file , weights_only = True )
751
751
torch .testing .assert_close (
752
752
out .argmax (dim = 1 ), expected .argmax (dim = 1 ), rtol = prec , atol = prec , check_device = False
753
753
)
@@ -847,7 +847,7 @@ def compute_mean_std(tensor):
847
847
# as in NMSTester.test_nms_cuda to see if this is caused by duplicate
848
848
# scores.
849
849
expected_file = _get_expected_file (model_name )
850
- expected = torch .load (expected_file )
850
+ expected = torch .load (expected_file , weights_only = True )
851
851
torch .testing .assert_close (
852
852
output [0 ]["scores" ], expected [0 ]["scores" ], rtol = prec , atol = prec , check_device = False , check_dtype = False
853
853
)
0 commit comments