Skip to content

Function request: np.copy (alias of clone?) #42053

@avloss

Description

@avloss

🚀 Feature

Add aliases for functions which are present in Numpy and perform similar (same?) functionality to PyTorch.

Motivation

Too often one ends up jumping between PyTorch and Numpy (for plotting purposes, but also for scipy and other things). It's more than frequent that one encounters AttributeError: 'Tensor' object has no attribute 'clip', when by inaccuracy applies function of the wrong name. It's understandable, that naming convention for PyTorch, perhaps, has a good motivation behind it, but adding convenience aliases could alleviate some of unnecessary pain.

Pitch

Introducing aliases for some functionality found in NumPy. NumPy has 1+ version and a stable API, which is familiar to most Python users who work with numerical data.

Alternatives

Adding a wrapper library, creating a library to monkey-patch the repo, or forking the repo. None of those are desirable, since the risk of breaking things would overweight any kind of convenience benefits.

Additional context

I understand that this is unlikely to be done, but simply wanted to see community opinion about this issue, and if, perhaps, I'm missing some understanding behind those differences in naming.

cc @mruberry @rgommers

Metadata

Metadata

Assignees

No one assigned

    Labels

    function requestA request for a new function or the addition of new arguments/modes to an existing function.module: numpyRelated to numpy support, and also numpy compatibility of our operatorstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions