Skip to content

Commit 1ee3050

Browse files
author
haozhe.zhu
committed
remove copy ut
1 parent 1454088 commit 1ee3050

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

tests/cpu/test_bf16_lazy_reorder.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,31 +1956,5 @@ def test_save_and_load(self):
19561956
torch.save(output_dpcpp, 'tensor_dpcpp.pt')
19571957
self.assertEqual(torch.load('tensor.pt'), torch.load('tensor_dpcpp.pt'))
19581958

1959-
class TestCopy_(TestCase):
1960-
def test_copy_(self):
1961-
rand_seed = int(get_rand_seed())
1962-
print("{} rand sed: {}".format(sys._getframe().f_code.co_name, rand_seed))
1963-
torch.manual_seed(rand_seed)
1964-
self_auto_mix = torch.randn(3, 4, 5, dtype=torch.float32, device=device) * 10
1965-
self_man_mix = (torch.randn(3, 4, 5, device=device) * 10).to(torch.bfloat16)
1966-
src_auto_mix = torch.randn(3, 4, 5, dtype=torch.float32, device=device) * 10
1967-
copy_src_auto_mix = copy.deepcopy(src_auto_mix).to(device=device)
1968-
copy_src_man_mix = copy.deepcopy(src_auto_mix).to(device=device).to(torch.bfloat16)
1969-
1970-
with AutoDNNL(True), AutoMixPrecision(False):
1971-
res_man_bf16 = copy_src_man_mix + copy_src_man_mix
1972-
self.assertEqual(res_man_bf16.dtype, torch.bfloat16)
1973-
self_man_mix.copy_(res_man_bf16)
1974-
self.assertEqual(self_man_mix.dtype, torch.bfloat16)
1975-
1976-
with AutoMixPrecision(True):
1977-
res_auto_mix = copy_src_auto_mix + copy_src_auto_mix
1978-
self.assertEqual(res_auto_mix.dtype, torch.float)
1979-
self.assertTrue(ipex.core.is_bf16_dil_tensor(res_auto_mix))
1980-
self_auto_mix.copy_(res_auto_mix)
1981-
self.assertTrue(ipex.core.is_bf16_dil_tensor(self_auto_mix))
1982-
self.assertEqual(self_auto_mix.dtype, torch.float)
1983-
self.assertEqual(self_auto_mix, self_man_mix.float())
1984-
19851959
if __name__ == '__main__':
19861960
test = unittest.main()

0 commit comments

Comments
 (0)