Skip to content

Commit

Permalink
Add environment variable to disable runtime exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Dec 18, 2024
1 parent be7f69a commit faf62d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/jaxsim/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import jax


Expand All @@ -18,7 +20,9 @@ def raise_if(
"""

# Disable host callback if running on TPU.
if jax.devices()[0].platform == "tpu":
if jax.devices()[0].platform == "tpu" or os.environ.get(
"JAXSIM_DISABLE_EXCEPTIONS", 0
):
return

# Check early that the format string is well-formed.
Expand Down

0 comments on commit faf62d9

Please sign in to comment.