Skip to content

Commit ac01b5c

Browse files
added conjugate array method (#1011)
1 parent 4397f91 commit ac01b5c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

dpnp/dpnp_array.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,19 @@ def conj(self):
390390
else:
391391
return dpnp.conjugate(self)
392392

393-
# 'conjugate',
393+
def conjugate(self):
394+
"""
395+
Return the complex conjugate, element-wise.
396+
397+
For full documentation refer to :obj:`numpy.ndarray.conjugate`.
398+
399+
"""
400+
401+
if not numpy.issubsctype(self.dtype, numpy.complex):
402+
return self
403+
else:
404+
return dpnp.conjugate(self)
405+
394406
# 'copy',
395407
# 'ctypes',
396408
# 'cumprod',

tests/skipped_tests_gpu.tbl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,6 @@ tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py::TestRealImag::tes
385385
tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py::TestRealImag::test_real_setter_zero_dim
386386
tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py::TestRealImag::test_real_zero_dim
387387
tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py::TestScalarConversion::test_scalar_conversion
388-
tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py::TestConj::test_conjugate
389-
tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py::TestConj::test_conjugate_pass
390388
tests/third_party/cupy/core_tests/test_ndarray_copy_and_view.py::TestArrayCopyAndView::test_astype
391389
tests/third_party/cupy/core_tests/test_ndarray_copy_and_view.py::TestArrayCopyAndView::test_astype_type
392390
tests/third_party/cupy/core_tests/test_ndarray_copy_and_view.py::TestArrayCopyAndView::test_astype_strides

0 commit comments

Comments
 (0)