Skip to content

testing.shaped_random does not accept shape () #2869

@niboshi

Description

@niboshi
>>> import cupy
>>> cupy.testing.shaped_random((), cupy)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/niboshi/w/repos/cupy/cupy/testing/helper.py", line 1150, in shaped_random
    return xp.asarray((numpy.random.rand(*shape) * scale).astype(dtype))
AttributeError: 'float' object has no attribute 'astype'

Version: current master (06972b5)

There are many lines of such usage in unit tests, but all of them are accompanied with @testing.numpy_cupy_raises() without explicit error type...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions