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

Debug 0 size reduction function #208

Open
ghost opened this issue Mar 19, 2019 · 2 comments
Open

Debug 0 size reduction function #208

ghost opened this issue Mar 19, 2019 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@ghost
Copy link

ghost commented Mar 19, 2019

In #85 , we found reduction functions have bug.
Reduction functions meet problem if input was 0 size ndarray.
In vega, reduction function will be hangup ( if input was 0 size ndarray).
In titanv, reduction function raise error ( if input was 0 size ndarray).
In furyx has no problem.

In #207 , I implemented exception code to solve this issue.
And pass the test_truth test.

But, I think there will be better way to over come this issue without exception code.

@LWisteria LWisteria added the bug Something isn't working label Mar 19, 2019
@LWisteria
Copy link
Member

@t-kitawaki Thank you for reporting. Can you provide steps to reproduce the bug?

@ghost
Copy link
Author

ghost commented Mar 19, 2019

To reproduce this issue, remove this code and run reduction function (like any all sum prod max min...) with 0 size input.

# TODO(tomoharu.kitawaki): debug 0 size reduction and remove this
if a.size == 0:
if self.identity in ['true', 'false']:
ret_identity = True if self.identity=='true' else False
else:
ret_identity = self.identity
ret = clpy.empty(out_shape, out_types[0])
ret.fill(ret_identity)
if out is not None:
out.fill(ret_identity)
return ret

Easy way to run 0 size reduction function is run clpy_tests/logic_tests/test_truth.py lile #85 .

@LWisteria LWisteria added this to the v2.1.0rc2 milestone Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant