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

Add support for Tensorflow SparseTensors: core classes. #839

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

hertschuh
Copy link
Collaborator

This adds:

  • Support for specifying sparse in KerasTensor and Input.
  • A boolean flag backend.SUPPORTS_SPARSE_TENSORS.
  • Support for tf.SparseTensor is Tensorflow core ops.

@hertschuh hertschuh requested a review from fchollet September 5, 2023 23:01
Copy link
Contributor

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

keras_core/backend/tensorflow/core.py Outdated Show resolved Hide resolved
keras_core/layers/core/input_layer.py Outdated Show resolved Hide resolved
keras_core/layers/core/input_layer.py Outdated Show resolved Hide resolved
@hertschuh hertschuh force-pushed the sparse_input branch 2 times, most recently from b0402b5 to a443cf8 Compare September 6, 2023 17:54
@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Patch coverage: 82.35% and project coverage change: +0.01% 🎉

Comparison is base (49e5b06) 70.90% compared to head (e15efe2) 70.92%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #839      +/-   ##
==========================================
+ Coverage   70.90%   70.92%   +0.01%     
==========================================
  Files         344      344              
  Lines       33300    33325      +25     
  Branches     6409     6417       +8     
==========================================
+ Hits        23612    23635      +23     
+ Misses       8093     8092       -1     
- Partials     1595     1598       +3     
Files Changed Coverage Δ
keras_core/backend/jax/core.py 89.13% <50.00%> (-0.93%) ⬇️
keras_core/backend/numpy/core.py 94.07% <50.00%> (-1.39%) ⬇️
keras_core/backend/torch/core.py 91.59% <50.00%> (-0.79%) ⬇️
keras_core/backend/common/keras_tensor.py 58.15% <100.00%> (+0.29%) ⬆️
keras_core/backend/jax/__init__.py 100.00% <100.00%> (ø)
keras_core/backend/numpy/__init__.py 100.00% <100.00%> (ø)
keras_core/backend/tensorflow/__init__.py 100.00% <100.00%> (ø)
keras_core/backend/tensorflow/core.py 96.18% <100.00%> (+0.24%) ⬆️
keras_core/backend/torch/__init__.py 100.00% <100.00%> (ø)
keras_core/layers/core/input_layer.py 90.90% <100.00%> (+0.66%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This adds:
- Support for specifying  sparse in `KerasTensor` and `Input`.
- A boolean flag `backend.SUPPORTS_SPARSE_TENSORS`.
- Support for `tf.SparseTensor` is Tensorflow core ops.
Copy link
Contributor

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@fchollet fchollet merged commit 67722d7 into keras-team:main Sep 6, 2023
@hertschuh hertschuh deleted the sparse_input branch September 6, 2023 20:56
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