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

Restored __array__ for libraries that do not support __array_interface__ #6489

Closed
wants to merge 1 commit into from

Conversation

radarhere
Copy link
Member

Resolves #6422

The issue has discovered that tensorflow supports converting Pillow images using __array__, but not __array_interface__. One solution would be to say that tensorflow should support __array_interface__, and an issue has been opened for that - tensorflow/tensorflow#56723

This PR is an alternative, where we add __array__, to provide support from our end. Conceivably, there may be other libraries that support __array__, but not __array_interface__. Testing, I find that NumPy prefers __array_interface__ over __array__, so this should not affect NumPy use.

@radarhere
Copy link
Member Author

This was resolved first by tensorflow - tensorflow/tensorflow@8b3369b

@radarhere radarhere closed this Aug 27, 2022
@radarhere radarhere deleted the array branch August 27, 2022 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9.2.0 breaks compatibility to pass PIL.Image to tensorflow (tf.reshape)
1 participant