@cmichelenstrofer Discovered that the following line in the mimo_transfer_mat function is jax/autograd illegal (in-place assignment)!
|
elem[idof][jdof] = block_diag(*blocks) |
However, based on some further reading of the jax documentation, they (at some point) have added a workaround for this where you do something like the following.
import jax.numpy as jnp
jax_array = jnp.zeros((3,3), dtype=jnp.float32)
# jax_array[1, :] = 1.0 # can't do this
updated_array = jax_array.at[1, :].set(1.0) # can do this!
There also appears to be better error tracking/handling in jax than autograd:
In [5]: jax_array[1,1] = 1.0
TypeError: JAX arrays are immutable and do not support in-place item assignment. Instead of x[idx] = y, use x = x.at[idx].set(y) or another .at[] method: https://docs.jax.dev/en/latest/_autosummary/jax.numpy.ndarray.at.html
We need to either rewrite the offending line or perhaps revist using jax (#118).
@cmichelenstrofer Discovered that the following line in the
mimo_transfer_matfunction isjax/autogradillegal (in-place assignment)!WecOptTool/wecopttool/core.py
Line 1558 in 66fd050
However, based on some further reading of the
jaxdocumentation, they (at some point) have added a workaround for this where you do something like the following.There also appears to be better error tracking/handling in
jaxthanautograd:We need to either rewrite the offending line or perhaps revist using
jax(#118).