Skip to content

empty_like does not respect the shape argument if it is () #15880

@eric-wieser

Description

@eric-wieser

The empty_like function recently learnt a shape argument in gh-13046.

However, this argument is not always respected:

>>> a = np.zeros(2)
>>> np.empty_like(a, shape=4).shape
(4,)
>>> np.empty_like(a, shape=()).shape
(2,)  # bug

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions