Skip to content

Instantly share code, notes, and snippets.

@jlebar
Created November 7, 2018 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlebar/797acbd6ce476ed35da4e976cb54e516 to your computer and use it in GitHub Desktop.
Save jlebar/797acbd6ce476ed35da4e976cb54e516 to your computer and use it in GitHub Desktop.
Example of switching xla.compile on or off via a flag
if should_use_xla():
result = xla.compile(model_fn, (x, y, z))[0]
else:
result = model_fn(x, y, z)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment