question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cp.where() failed on complex matrices

See original GitHub issue

I tried to use cp.where() on complex matrices, which seems not supported yet. Here is a snippet of the code

import cupy as cp
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)

the error message looks like

 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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
AntoineDujardincommented, May 9, 2019

Done

0reactions
asi1024commented, May 10, 2019

Merged #2175.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Features — CVXPY 1.2 documentation
A complex valued variable. x = cp.Variable(complex=True) # A purely imaginary parameter. p = cp.Parameter(imag=True) print("p.is_imag() = ", p.is_imag()) ...
Read more >
Complex number computational error grows as the size of ...
If I have two small complex matrices, the complex number multiplication is fine even when I do it manually (Breaking the complex numbers ......
Read more >
Linear Algebra - Julia Documentation
A linear solve involving such a matrix cannot be computed. The info field indicates the location of (one of) the singular value(s). Exception...
Read more >
Linear Algebra through Matrices
and scalar multiplication of matrices, Mm,n(C) is a complex vector space. ... For, if cp+1 = 0 then, Equation (3.3.4) has a non-trivial...
Read more >
Linear Algebra Problems 1 Basics - Penn Math
Let A be an n×n matrix of real or complex numbers. ... so P2 = P . If c = 1, find a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found