Replies: 1 comment
-
The best approach to speeding this up will involve rewriting it to avoid for i in range(x.shape[0]):
x = x.at[i].set(2 * i) While this will be fast: i = jnp.arange(len(x))
x = x.at[i].set(2 * i) I would suggest trying to use this sort of vectorized indexing to express your algorithm. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a loop to change big matrics' value,but only using "at" to change that.That's slower more than runing by numpy(I used gpu).So I want to konw how to chage the operation to speed up its runing.Belows is rest of my function.
Beta Was this translation helpful? Give feedback.
All reactions