Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fuse with *args without input_num #2598

Merged
merged 4 commits into from Apr 19, 2017
Merged

Fix fuse with *args without input_num #2598

merged 4 commits into from Apr 19, 2017

Conversation

niboshi
Copy link
Member

@niboshi niboshi commented Apr 19, 2017

Fix #2594

@niboshi niboshi mentioned this pull request Apr 19, 2017
@niboshi niboshi added cat:bug Bug report or fix. CuPy Related to CuPy. labels Apr 19, 2017
@okuta okuta self-assigned this Apr 19, 2017
Copy link
Member

@okuta okuta left a comment

Choose a reason for hiding this comment

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

LGTM except comments


@cupy.fuse(input_num=n)
def _check(self, func, n, gen, *args, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

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

How about this code?

def check(self, func, n, gen, *args):
    self._check(func, n, gen, args, True)

def _check(self, func, n, gen, args, omit_nin):
    nin = n if not omit_nin else None

self._check_reduce(func, n, reduce_f, gen, *args, omit_nin=True)
self._check_reduce(func, n, reduce_f, gen, *args, omit_nin=False)

def _check_reduce(self, func, n, reduce_f, gen, *args, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@niboshi
Copy link
Member Author

niboshi commented Apr 19, 2017

Thank you for review! Fixed it.

@okuta okuta added this to the v1.24.0 milestone Apr 19, 2017
@okuta okuta merged commit 7b1aa1a into master Apr 19, 2017
@okuta okuta deleted the fuse_args branch April 19, 2017 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:bug Bug report or fix. CuPy Related to CuPy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants