clpy icon indicating copy to clipboard operation
clpy copied to clipboard

Debug 0 size reduction function

Open ghost opened this issue 5 years ago • 2 comments

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.

ghost avatar Mar 19 '19 07:03 ghost

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

LWisteria avatar Mar 19 '19 07:03 LWisteria

To reproduce this issue, remove this code and run reduction function (like any all sum prod max min...) with 0 size input. https://github.com/fixstars/clpy/blob/1de64f1e1146df4baac365c413cedcadb974738a/clpy/core/reduction.pxi#L252-L262

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

ghost avatar Mar 19 '19 07:03 ghost