Skip to content

How to make an mlx array containing every number from 0-100 and skipping every Nth number #1554

Answered by angeloskath
kyrollosyanny asked this question in Q&A
Discussion options

You must be logged in to vote

Haven't tested it but something like the following should work

indices = mx.arange(100).reshape(-1, 4)
indices = indices[:, 1:].reshape(-1)
indices = mx.concatenate([mx.zeros((1,), type=mx.int32), indices])

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kyrollosyanny
Comment options

Answer selected by kyrollosyanny
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants