"CharTensor" numpy conversion is supported now (#21458)

Summary:
Fixed #21269 by removed the the expected `ValueError` when converting a tensor to a Numpy `int8` array in the Numba interoperability test.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21458

Differential Revision: D15696363

Pulled By: ezyang

fbshipit-source-id: f4ee9910173aab0b90a757e75c35925b026d1cc4
This commit is contained in:
Mads R. B. Kristensen
2019-06-06 09:58:49 -07:00
committed by Facebook Github Bot
parent c8083e0292
commit ee15ad1bd6

View File

@ -2,7 +2,7 @@ import unittest
import sys
import common_utils as common
from common_utils import TEST_NUMBA, TEST_NUMPY, IS_WINDOWS
from common_utils import TEST_NUMBA, TEST_NUMPY
from common_cuda import TEST_NUMBA_CUDA, TEST_CUDA, TEST_MULTIGPU
import torch
@ -117,12 +117,6 @@ class TestNumbaIntegration(common.TestCase):
]
for dt in torch_dtypes:
if dt == torch.int8 and not IS_WINDOWS:
# "CharTensor" numpy conversion not supported
with self.assertRaises(TypeError):
torch.arange(10).to(dt).numpy()
continue
# CPU tensors of all types do not register as cuda arrays,
# attempts to convert raise a type error.