Skip to content

Commit

Permalink
Skip test_init_transonified.py::TestsInit::test_pythranize for JAX
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jun 1, 2024
1 parent 3f39c68 commit 85d5d20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/transonic/backends/jax.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ def add_jax_comments(code):

# Add JIT decorator
if isinstance(node, gast.FunctionDef):
new_body.append(
CommentLine("# __protected__ @jit")
)
new_body.append(CommentLine("# __protected__ @jit"))
new_body.append(node)

mod.body = new_body
Expand Down
2 changes: 1 addition & 1 deletion src/transonic/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def can_import_accelerator(backend: str = backend_default):
import numba
except ImportError:
return False
elif backend =="jax":
elif backend == "jax":
try:
import jax
except ImportError:
Expand Down
3 changes: 3 additions & 0 deletions tests/test_init_transonified.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ def test_transonified(self):
for_test_init.func1(1.1, 2.2)
for_test_init.check_class()

@unittest.skipIf(
backend.name == "jax", "Not yet supported by our JAX backend"
)
@unittest.skipIf(
sys.platform.startswith("win") or not can_import_accelerator(),
f"{backend.name} is required for TRANSONIC_COMPILE_AT_IMPORT",
Expand Down

0 comments on commit 85d5d20

Please sign in to comment.