Поддержка cp.where () для сложной матрицы - PullRequest
0 голосов
/ 25 апреля 2019

Я пытался использовать cp.where() на сложных матрицах, которые пока не поддерживаются. Вот фрагмент кода

a = cp.random.rand(2,2).astype(cp.complex64)
b = cp.random.rand(2,2).astype(cp.complex64)
c = cp.array([[0,0],[1,1]])
d = cp.where(c,a,b)

сообщение об ошибке выглядит как

  File "<stdin>", line 1, in <module>
  File "/home/liangs/anaconda3/envs/tensorflow/lib/python3.5/site-packages/cupy/sorting/search.py", line 136, in where
    return _where_ufunc(condition.astype('?'), x, y)
  File "cupy/core/_kernel.pyx", line 833, in cupy.core._kernel.ufunc.__call__
  File "cupy/core/_kernel.pyx", line 704, in cupy.core._kernel._guess_routine
TypeError: Wrong type ((<class 'numpy.bool_'>, <class 'numpy.complex64'>, <class 'numpy.complex64'>)) of arguments for cupy_where
...