Replies: 1 comment 3 replies
-
If you want to know the number of nonzero entries, you can use:
If you want to create an array with only the nonzero entries, that's not possible within a JAX transform because the number of entries is dynamic. Depending on what you want to do with those entries, there may be a number of solutions: for example you could create a padded the array to a static size by using the |
Beta Was this translation helpful? Give feedback.
3 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.
-
Hello
How I need to detect the subdiagonal non zero entries of quasi-triangular matrix R (which is computed several times)
In python I have:
r = np.where(np.abs(np.diag(R, -1)) > 100*eps)[0]
with Jax the issue is that the number of subdiagonal elements that are non zeros can change (not the overall size of the matrix). Any smart way of doing that?
Beta Was this translation helpful? Give feedback.
All reactions