dpnp
dpnp copied to clipboard
Add type check in arange function
Test tests/third_party/cupy/creation_tests/test_ranges.py::TestRanges::test_arange9 fails with Fatal Python error: Aborted.
Looks like that issue is in provided dtype and ValueError is expected:
def test_arange9(self):
for xp in (numpy, cupy):
with pytest.raises(ValueError):
xp.arange(10, dtype=xp.bool_)
it looks like the issue is in unsupported type bool_
tests/third_party/cupy/creation_tests/test_ranges.py::TestRanges::test_arange9 Traceback (most recent call last):
File "dpnp/dpnp_utils.pyx", line 114, in dpnp.dpnp_utils.checker_throw_type_error
raise TypeError(f"{ERROR_PREFIX} in function {function_name}() type '{given_type}' is not supported")
TypeError: DPNP error: in function dpnp_dtype_to_DPNPFuncType() type '<class 'numpy.bool_'>' is not supported
Exception ignored in: 'dpnp.backend.dpnp_dtype_to_DPNPFuncType'
Traceback (most recent call last):
File "dpnp/dpnp_utils.pyx", line 114, in dpnp.dpnp_utils.checker_throw_type_error
raise TypeError(f"{ERROR_PREFIX} in function {function_name}() type '{given_type}' is not supported")
TypeError: DPNP error: in function dpnp_dtype_to_DPNPFuncType() type '<class 'numpy.bool_'>' is not supported
terminate called after throwing an instance of 'std::runtime_error'
what(): DPNP Error: Function ID with unsupported first parameter type.
Fatal Python error: Aborted