Skip to content

Implement shape argument in *_like functions #4875

@pentschev

Description

@pentschev

The shape argument in empty_like (and counterparts: full_like, ones_like and zeros_like) is important to guarantee functions that depend on creation of such arrays (without _like) to work correctly with the introduction of NEP-18 and _meta in Dask arrays. The argument was introduced by numpy/numpy#13046.

An example where we need such functionality is the moment function, creating both ones and zeros, also with non-default chunks:

return ones(reduced.shape, chunks=reduced.chunks, dtype='f8')

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