mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Enable torch.isclose
to suppport bool tensors (#61271)
Summary: Fixes https://github.com/pytorch/pytorch/issues/60533 Pull Request resolved: https://github.com/pytorch/pytorch/pull/61271 Reviewed By: zhxchen17 Differential Revision: D29737618 Pulled By: SplitInfinity fbshipit-source-id: 45314bc7e0b9a28c10700455b1e6267c0db3eefc
This commit is contained in:
committed by
Facebook GitHub Bot
parent
243c7079a1
commit
3d6aa3a2f6
@ -244,8 +244,6 @@ class TestTesting(TestCase):
|
||||
expected = test[2]
|
||||
self.assertEqual(actual.item(), expected)
|
||||
|
||||
# torch.close is not implemented for bool tensors
|
||||
# see https://github.com/pytorch/pytorch/issues/33048
|
||||
def test_isclose_comparetensors_bool(self, device):
|
||||
tests = (
|
||||
(True, True, True),
|
||||
@ -254,9 +252,7 @@ class TestTesting(TestCase):
|
||||
(False, True, False),
|
||||
)
|
||||
|
||||
with self.assertRaises(RuntimeError):
|
||||
self._isclose_helper(tests, device, torch.bool, False)
|
||||
|
||||
self._isclose_helper(tests, device, torch.bool, False)
|
||||
self._comparetensors_helper(tests, device, torch.bool, False)
|
||||
|
||||
@dtypes(torch.uint8,
|
||||
|
Reference in New Issue
Block a user