Skip to content

Commit f5a6c12

Browse files
the conj array method (#1010)
1 parent f9dee9f commit f5a6c12

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

dpnp/dpnp_array.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,20 @@ def astype(self, dtype, order='K', casting='unsafe', subok=True, copy=True):
376376
# 'choose',
377377
# 'clip',
378378
# 'compress',
379-
# 'conj',
379+
380+
def conj(self):
381+
"""
382+
Complex-conjugate all elements.
383+
384+
For full documentation refer to :obj:`numpy.ndarray.conj`.
385+
386+
"""
387+
388+
if not numpy.issubsctype(self.dtype, numpy.complex):
389+
return self
390+
else:
391+
return dpnp.conjugate(self)
392+
380393
# 'conjugate',
381394
# 'copy',
382395
# 'ctypes',

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_conj
389-
tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py::TestConj::test_conj_pass
390388
tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py::TestConj::test_conjugate
391389
tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py::TestConj::test_conjugate_pass
392390
tests/third_party/cupy/core_tests/test_ndarray_copy_and_view.py::TestArrayCopyAndView::test_astype

0 commit comments

Comments
 (0)