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

Get rid of last tensorflow backend specificities #125

Merged
merged 4 commits into from
Jan 8, 2024

Conversation

nhuet
Copy link
Contributor

@nhuet nhuet commented Dec 15, 2023

We still had some code specific to tensorflow that we should make more agnostic now that we are using keras 3 which can work on several backends:

  • unconditionned tensorflow imports in modules -> removed
  • .numpy() -> keras.ops.convert_to_numpy()
    - tf.linalg.solve() -> create a LinalgSolve keras operation which internally will check the backend to use proper code

nhuet added 4 commits January 8, 2024 11:10
To depend on keras 3.0 without enforcing a specific backend (tensorflow)
we get rid of the last usage of tensorflow inside decomon library which
is tf.linalg.solve.

We create a dedicated operation which calls the proper function
according to backend.

For now, for other backend than tensorflow we raise a
NotImplementedError.

We update the test accordingly. And the get_lower_linear_hull_max() being bugged for now we
xfail it.
To be fully agnostic, we prefer having utility functions that are
checking the backend use like now `is_in_gpu_mode()`.
@nhuet nhuet marked this pull request as ready for review January 8, 2024 10:11
@ducoffeM ducoffeM merged commit 8f6990f into airbus:keras3 Jan 8, 2024
9 checks passed
@nhuet nhuet deleted the agnostic branch January 11, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants