Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make jax2tf import conditional #911

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions keras_core/export/export_lib.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Library for exporting inference-only Keras models/layers."""

from jax.experimental import jax2tf

from keras_core import backend
from keras_core.api_export import keras_core_export
from keras_core.layers import Layer
Expand Down Expand Up @@ -441,6 +439,8 @@
self._tf_trackable._misc_assets.append(trackable)

def _convert_jax2tf_function(self, fn, input_signature):
from jax.experimental import jax2tf

Check warning on line 442 in keras_core/export/export_lib.py

View check run for this annotation

Codecov / codecov/patch

keras_core/export/export_lib.py#L442

Added line #L442 was not covered by tests

shapes = []
for spec in input_signature:
shapes.append(self._spec_to_poly_shape(spec))
Expand Down