-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
31 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import casadi as cs | ||
|
||
from jaxadi import lower, translate, declare | ||
|
||
# define input variables for the function | ||
x = cs.SX.sym("x", 10, 10) | ||
y = cs.SX.sym("y", 10, 10) | ||
casadi_fn = cs.Function("myfunc", [x, y], [x @ y]) | ||
|
||
print("Signature of the CasADi function:") | ||
print(casadi_fn) | ||
|
||
# define jax function from casadi one | ||
jax_fn = declare(translate(casadi_fn)) | ||
|
||
print("Lowered JAX function:") | ||
print(lower(jax_fn, casadi_fn)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from ._compile import lower | ||
from ._convert import convert | ||
from ._translate import translate | ||
from ._declare import declare |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters