Exporting to sympy, pytorch, jax for template model #857
-
Hi! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Sorry, they are unfortunately incompatible. The reason is that a template expression allows for any Julia code within the template (even if-statements, while-loops, external library calls, storage, etc.), so one would need to create an entire translation library between Julia and SymPy just to make this work generally. For simple expressions, it might be possible, but we made the choice to avoid adding the functionality, because it might result in some silent bugs if we have such a feature. I think the safest route is to translate it to SymPy manually. Edit: I guess, maybe one route is to allow the user to define a |
Beta Was this translation helpful? Give feedback.
Sorry, they are unfortunately incompatible. The reason is that a template expression allows for any Julia code within the template (even if-statements, while-loops, external library calls, storage, etc.), so one would need to create an entire translation library between Julia and SymPy just to make this work generally.
For simple expressions, it might be possible, but we made the choice to avoid adding the functionality, because it might result in some silent bugs if we have such a feature. I think the safest route is to translate it to SymPy manually.
Edit: I guess, maybe one route is to allow the user to define a
sympy_expression_spec
or something? Then the user would be responsible fo…