Implement numpy(force=True) (#109636)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/109636
Approved by: https://github.com/ezyang
ghstack dependencies: #109634
This commit is contained in:
lezcano
2023-09-20 16:08:02 +00:00
committed by PyTorch MergeBot
parent 1f6828ca99
commit 8597d37536
5 changed files with 30 additions and 9 deletions

View File

@ -1820,6 +1820,7 @@ class TestOldViewOps(TestCase):
x = torch.tensor([[1, 2], [3, 4], [5, 6]], dtype=dt, device=device)
self.assertEqual(x.view(6).shape, [6])
@skipIfTorchDynamo("conj bit not implemented in TensorVariable yet")
@onlyCPU
def test_conj_neg_view_numpy_error(self, device):
self.assertRaisesRegex(RuntimeError, "has conjugate bit set", lambda: torch.tensor([1 + 2j]).conj().numpy())