Closed Mr-Tony921 closed 6 months ago
Thanks! Should "ret = x.base is y.base" be "ret = (x.base == y.base)"?
Thanks! Should "ret = x.base is y.base" be "ret = (x.base == y.base)"?
Yep! I didn't consider the issue with element-wise comparison of numpy arrays. It has been fixed and submitted.
This pull request addresses issue #23. I encountered the same error in the share_memory function when using Python 3.10. The error occurs due to incompatible shapes during the comparison of x.base and y.base.
To fix this, I added a shape compatibility check before performing the base comparison. If the shapes are incompatible, the function now safely returns False without attempting the comparison. This prevents the ValueError and ensures the function works correctly across different environments.