File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 4
4
import torch
5
5
6
6
from torchao .float8 .float8_utils import _round_scale_down_to_power_of_2
7
+ from torchao .utils import TORCH_VERSION_AT_LEAST_2_5
8
+
9
+ if not TORCH_VERSION_AT_LEAST_2_5 :
10
+ pytest .skip ("Unsupported PyTorch version" , allow_module_level = True )
7
11
8
12
9
13
# source for notable single-precision cases:
@@ -33,6 +37,11 @@ def test_round_scale_down_to_power_of_2_valid_inputs(
33
37
torch .tensor (expected_result ).cuda (),
34
38
)
35
39
result = _round_scale_down_to_power_of_2 (input_tensor )
40
+
41
+ print (f"input: { input } " )
42
+ print (f"input tensor: { input_tensor } " )
43
+ print (f"result: { result } " )
44
+ print (f"expected_result: { expected_result } " )
36
45
assert (
37
46
torch .equal (result , expected_tensor )
38
47
or (result .isnan () and expected_tensor .isnan ())
You can’t perform that action at this time.
0 commit comments