Skip to content

fix RecursionError bug in conj method of sparse matrix classes - #1846

Merged
okuta merged 4 commits into
cupy:masterfrom
grlee77:sparse_conj_fix
Dec 27, 2018
Merged

okuta merged 4 commits into
cupy:masterfrom
grlee77:sparse_conj_fix

Conversation

@grlee77

@grlee77 grlee77 commented Nov 30, 2018

Copy link
Copy Markdown
Member

A conj method is defined for the sparse matrix classes in current master, but results in infinite recursion when used.

Here is a minimal example to reproduce the bug (run on the current master branch):

import cupy
cupy.cupyx.scipy.sparse.eye(5).conj()

which results in an error ending in:

  File "/media/Data1/cupy/cupyx/scipy/sparse/base.py", line 258, in conj
    return self.tocsr().conj()

RecursionError: maximum recursion depth exceeded

The conj method of the cupyx.scipy.sparse.spmatrix classes for COO, CSR, CSC and DIA is implemented in this PR.

The docstrings and implementation closely follow those for the corresponding methods in scipy.sparse.

@niboshi niboshi self-assigned this Dec 3, 2018
@niboshi niboshi added the cat:bug Bugs label Dec 3, 2018

@okuta okuta left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR. LGTM except comments.

jenkins, test this please.

Comment thread cupyx/scipy/sparse/base.py Resolved
@okuta okuta assigned okuta and unassigned niboshi Dec 24, 2018
@okuta okuta added the to-be-backported Pull-requests to be backported to stable branch label Dec 24, 2018
@okuta okuta added this to the v6.0.0b2 milestone Dec 24, 2018
@okuta

okuta commented Dec 26, 2018

Copy link
Copy Markdown
Member

jenkins, test this please.

@chainer-ci

Copy link
Copy Markdown
Member

Jenkins CI test (for commit f461412, target branch master) succeeded!

@okuta

okuta commented Dec 27, 2018

Copy link
Copy Markdown
Member

LGTM!

@okuta
okuta merged commit 7f65f1f into cupy:master Dec 27, 2018
@chainer-ci

Copy link
Copy Markdown
Member

@okuta This pull-request is marked as to-be-backported, but the corresponding backport PR could not be found. Could you check?

@grlee77
grlee77 deleted the sparse_conj_fix branch December 31, 2018 17:07
@chainer-ci

Copy link
Copy Markdown
Member

@okuta This pull-request is marked as to-be-backported, but the corresponding backport PR could not be found. Could you check?

okuta added a commit to okuta/cupy that referenced this pull request Jan 8, 2019
fix RecursionError bug in conj method of sparse matrix classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:bug Bugs to-be-backported Pull-requests to be backported to stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants