Fix testing.shaped_random for shape ()#2870
Conversation
94a76db to
7d69f53
Compare
toslunar
left a comment
There was a problem hiding this comment.
Instead of .astype(dtype), how about using xp.asarray(..., dtype)?
7d69f53 to
c15d8c6
Compare
|
Thank you for suggestion. |
toslunar
left a comment
There was a problem hiding this comment.
Could you also fix the boolean case for consistency? LGTM except for it.
6078e6c to
73d720e
Compare
|
Jenkins, test this please. |
|
Successfully created a job for commit 73d720e: |
|
Jenkins CI test (for commit 73d720e, target branch master) failed with status FAILURE. |
fe9de14 to
e431326
Compare
|
PTAL |
- Parameterize shape - Add check for array type - Skip imag check for 0-size arrays (due to a bug)
ba5da72 to
d6c47cb
Compare
| # Test ranks | ||
|
|
||
| # TODO(niboshi): Fix xfail | ||
| @pytest.mark.xfail(strict=True, reason='Explicit error types required') |
There was a problem hiding this comment.
strict=True requires further care. In fact, XPASS with numpy 1.12. (AxisError is since 1.13. xfail by a different reason with numpy 1.9.)
| if 0 not in self.shape: | ||
| # TODO(niboshi): imag causes an error if size=0. Fix it. | ||
| self.assertTrue(self.xp.all(0 <= a.imag)) | ||
| self.assertTrue(self.xp.all(a.imag < 10)) |
There was a problem hiding this comment.
Why does 0 <= a.imag < 10 fail?
if 0 not in self.shape: self.assertTrue(self.xp.any(a.imag)) looks correct (without TODO).
There was a problem hiding this comment.
This is how the test was originally written and I'm not going to change it.
a.imag causes assertion error (#2885).
|
Jenkins, test this please. |
|
Successfully created a job for commit c7f558e: |
|
Jenkins CI test (for commit c7f558e, target branch master) succeeded! |
Fix `testing.shaped_random` for shape `()`
|
v6 backport? (needed for #2891) |
The bug has been fixed (cupy#2870)
Fixes #2869