__array_interface__ support? #56723
Labels
comp:apis
Highlevel API related issues
stat:awaiting tensorflower
Status - Awaiting response from tensorflower
TF 2.9
Issues found in the TF 2.9 release (or RCs)
type:feature
Feature requests
Click to expand!
Issue Type
Feature Request
Source
source
Tensorflow Version
2.6.0
Custom Code
No
OS Platform and Distribution
No response
Mobile device
No response
Python version
3.8
Bazel version
No response
GCC/Compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current Behaviour?
Hi. Over at https://github.com/python-pillow/Pillow, our Image class has the
__array_interface__
attribute, to support converting Pillow images to NumPy. See https://numpy.org/doc/stable/reference/arrays.interface.html#object.__array_interface__A recent discussion has revealed that TensorFlow's
reshape
method (and I have to imagine other methods as well) accepts an object that provides an__array__
method, but not an object with an__array_interface__
attribute.My question - is there any interest from TensorFlow in supporting objects with
__array_interface__
?Standalone code to reproduce the issue
Here is code that fails with the latest version of Pillow.
However, if my assertion that TensorFlow doesn't accept
__array_interface__
is at all in doubt, let me know and I'll put together a better example.The text was updated successfully, but these errors were encountered: