You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
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]]