Skip to content

Incorrect getitem test? #172

Open
Open
@asmeurer

Description

@asmeurer

cupy fails test_getitem with:

E                       AssertionError: out=-0.0, should be 0.0 [__getitem__()]
E                       Falsifying example: test_getitem(
E                           shape=(1,), dtype=numpy.float32, data=data(...),
E                       )
E                       Draw 1 (obj): [-0.0]
E                       x=array([-0.], dtype=float32)
E                       Draw 2 (key): (0,)

It seems like it is saying that asarray([-0.0])[0,] should be 0.0 instead of -0.0. CuPy appears to be correct:

>>> import cupy as cp
>>> cp.array([-0.0], dtype=cp.float32)[0,]
array(-0., dtype=float32)

It's possible I'm misinterpreting the test. The output of the tests when there are data().draw()s isn't always very readable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions