Cannot generate arrays with dimensions set at runtime #19561
Unanswered
joacorapela
asked this question in
Q&A
Replies: 2 comments
-
It seems that this cannot be done with |
Beta Was this translation helpful? Give feedback.
0 replies
-
No, you cannot create arrays with shapes set at runtime, unless you run in eager mode (e.g. outside Typical workarounds are to set static shapes of some maximum size, and use padded representations for dynamically-shaped arrays within your program. |
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 want to create in JAX matrices and vectors with dimensions set at runtime. Can this be done in JAX?
If the dimension of these matrices and vectors is fixed at runtime, I can do it with the following code
However, if their dimensions is determined at runtime, I cannot create similar random
vectors and matrices with the following code.
The previous code has at least two problems:
The following line generates the error below
I cannot use expanding lists in the carry variable.
Is there a workaround in JAX to create matrices with dimensions set at runtime?
Joaquin
Beta Was this translation helpful? Give feedback.
All reactions