Skip to content

Commit c591445

Browse files
authored
Remove float testing for _max_value (#3103)
It's not used currently and can lead to exceptions such as runtime error: 5.7896e+76 is outside the range of representable values of type 'float'
1 parent e2e323c commit c591445

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/test_transforms.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,10 @@ def test_max_value(self):
557557
for dtype in int_dtypes():
558558
self.assertEqual(F_t._max_value(dtype), torch.iinfo(dtype).max)
559559

560-
for dtype in float_dtypes():
561-
self.assertGreater(F_t._max_value(dtype), torch.finfo(dtype).max)
560+
# remove float testing as it can lead to errors such as
561+
# runtime error: 5.7896e+76 is outside the range of representable values of type 'float'
562+
# for dtype in float_dtypes():
563+
# self.assertGreater(F_t._max_value(dtype), torch.finfo(dtype).max)
562564

563565
def test_convert_image_dtype_float_to_float(self):
564566
for input_dtype, output_dtypes in cycle_over(float_dtypes()):

0 commit comments

Comments
 (0)