Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sympy.Array support #11

Open
lmriccardo opened this issue Aug 2, 2023 · 1 comment
Open

sympy.Array support #11

lmriccardo opened this issue Aug 2, 2023 · 1 comment

Comments

@lmriccardo
Copy link

lmriccardo commented Aug 2, 2023

It would be possible to add support for sympy.Array objects? It might be useful in case like:

from sympy import Array
from sympy.abc import x
from sympy2jax import SymbolicModule

a = Array([1,2,3])
e = a * x
j = SymbolicModule(e)
j(x=2)

# Output --> jax.DeviceArray([2, 4, 6], dtype=int64)

Obviously, when there is no the possibility to give an array directly as "subs" to the SymbolicModule.

Thanks you for the answer!

@patrick-kidger
Copy link
Owner

I'd be happy to take PR (with tests) on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants