Skip to content

Bug for 0-size arrays in __cuda_array_interface__ #2610

@leofang

Description

@leofang

From #2536 (comment):

>>> import cupy as cp
>>> a = cp.arange(3)
>>> b=a[0:1:-1]
>>> b.size
0
>>> b.__cuda_array_interface__
{'shape': (0,), 'typestr': '<i8', 'descr': [('', '<i8')], 'data': (139843608772608, False), 'version': 2, 'strides': None}

b is a 0-size array but it's pointer is not 0, violating the v2 protocol.

This is due to my oversight when updating the interface...😞 PR to follow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions