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

Python functions must return zero or more Tensors or ExtensionTypes or None values #367

Open
khatchad opened this issue Sep 24, 2024 · 0 comments
Labels
bug Something isn't working preconditions Refactoring preconditions need to be added.

Comments

@khatchad
Copy link
Member

khatchad commented Sep 24, 2024

FAILED tests/keras/test_factorized_top_k.py::TestFactorizedTopK::test_factorized_topk_metrics0 - TypeError: To be compatible with tf.function, Python functions must return zero or more Tensors or ExtensionTypes or None values; in compilation of <function FactorizedTopK.update_state at 0x7508542b2830>, found return value of type Operation, which is not a Tensor or ExtensionType.

https://www.tensorflow.org/guide/extension_type

  • tf.function has certain restrictions on what types of values Python functions can return.
  • tf.function decorated functions can only return:
    • Zero or more Tensor objects (the core data structure in TensorFlow).
    • Zero or more ExtensionType objects (certain custom TensorFlow types).
    • None.

https://g.co/gemini/share/69dac2e125e9

@khatchad khatchad added bug Something isn't working preconditions Refactoring preconditions need to be added. labels Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preconditions Refactoring preconditions need to be added.
Projects
None yet
Development

No branches or pull requests

1 participant