From: Tongzhou Wang Date: Wed, 27 Mar 2019 03:55:25 +0000 (-0700) Subject: fix #16448 (#18479) X-Git-Tag: accepted/tizen/6.5/unified/20211028.231830~605 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=60538c8366587d9b8b08226c953c98a0013b833f;p=platform%2Fupstream%2Fpytorch.git fix #16448 (#18479) Summary: Fixes #16448 bddppq Pull Request resolved: https://github.com/pytorch/pytorch/pull/18479 Differential Revision: D14635360 Pulled By: ezyang fbshipit-source-id: 4010319fbce050dd0bdf4da3cd1171b9737f3c4c --- diff --git a/test/common_utils.py b/test/common_utils.py index 43131c0..cca6663 100644 --- a/test/common_utils.py +++ b/test/common_utils.py @@ -421,12 +421,7 @@ class TestCase(expecttest.TestCase): if a.device.type == 'cpu' and a.dtype == torch.float16: # CPU half tensors don't have the methods we need below a = a.to(torch.float32) - if TEST_WITH_ROCM: - # Workaround for bug https://github.com/pytorch/pytorch/issues/16448 - # TODO: remove after the bug is resolved. - b = b.to(a.dtype).to(a.device) - else: - b = b.to(a) + b = b.to(a) if (a.dtype == torch.bool) != (b.dtype == torch.bool): raise TypeError("Was expecting both tensors to be bool type.")