Skip to content

Commit ef6b284

Browse files
committed
Add test case
1 parent 3600da6 commit ef6b284

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/test_data_type.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ def test_datatype_f64(self):
4848
else:
4949
assert 'f64' in device_data_hlo, device_data_hlo
5050

51+
def test_datatype_f32_div_f64(self):
52+
t1 = torch.rand(2, 2, dtype=torch.float, device=xm.xla_device())
53+
t2 = t1 / 2.0
54+
hlo_text = torch_xla._XLAC._get_xla_tensors_text([t2])
55+
assert t2.dtype == torch.float
56+
assert 'f64' not in hlo_text
57+
5158

5259
if __name__ == '__main__':
5360
print(f'XLA_USE_BF16: {os.getenv("XLA_USE_BF16")}')

0 commit comments

Comments
 (0)