Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Feature Request: 'arange_like/enumerate' operator #14574

Closed
fhieber opened this issue Mar 31, 2019 · 3 comments
Closed

Feature Request: 'arange_like/enumerate' operator #14574

fhieber opened this issue Mar 31, 2019 · 3 comments

Comments

@fhieber
Copy link
Contributor

fhieber commented Mar 31, 2019

It would be quite useful to have an operator that can create ranges based on an existing 'shape_like' symbol, similar to the ops zeros_like, ones_like, and other *_like.

For example, I would like to enumerate the positions of a symbol with dynamic shape:

x = mx.sym.Variable('x')
r = mx.sym.arange_like(x, start=0)
r.eval(x=mx.nd.ones((4,))) # should give: [0, 1, 2, 3]
r.eval(x=mx.nd.ones((2,))) # should give: [0, 1]
r2 = mx.sym.arange_like(x, start=5)
r.eval(x=mx.nd.ones((2, 2))) # should give: [[5, 6], [7, 8]]

Another name could be 'enumerate'.

@mxnet-label-bot
Copy link
Contributor

Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended labels: Feature

@fhieber fhieber changed the title Feature Request: 'arange_like' operator Feature Request: 'arange_like/enumerate' operator Mar 31, 2019
@vdantu
Copy link
Contributor

vdantu commented Apr 1, 2019

@mxnet-label-bot add [operator, feature request]

@fhieber
Copy link
Contributor Author

fhieber commented Aug 5, 2019

Resolved by #15400

@fhieber fhieber closed this as completed Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants