GH-40348: [Python] Add Python wrapper for VariableShapeTensor#40354
GH-40348: [Python] Add Python wrapper for VariableShapeTensor#40354rok wants to merge 4 commits intoapache:mainfrom
Conversation
AlenkaF
left a comment
There was a problem hiding this comment.
Small nits =) Thank you for working on this, takes lots of work!
b6b63a6 to
a372fe6
Compare
|
The failures are connected. |
fab047e to
f58c973
Compare
5197532 to
55cc40b
Compare
| internal::Permute<int64_t>(permutation, &shape); | ||
| ARROW_ASSIGN_OR_RAISE( | ||
| auto strides, internal::ComputeStrides(ext_type.value_type(), shape, permutation)); | ||
| internal::Permute<int64_t>(permutation, &shape); | ||
|
|
There was a problem hiding this comment.
I'm thinking thinking about this still. It's probably a bug or a different interpretation at least.
0df8139 to
d5a548d
Compare
|
@AlenkaF could you do a quick pass on this? I'm a little unsure about the |
|
@rok sure! Will have a look later today. |
|
I did a very quick look at the code now. I would suggest splitting this PR into two as there is quite a lot of lines added and there might be even something that can be moved out. Moving the |
Add PyArrow bindings for the VariableShapeTensor extension type, including VariableShapeTensorType, VariableShapeTensorArray, and VariableShapeTensorScalar with support for converting to/from NumPy tensors.
Agreed, I moved these into a separate PR and rebased here. I think this is ready for a more final review. |
AlenkaF
left a comment
There was a problem hiding this comment.
Thank you for adding this @rok! Huge amount of work was needed here (and in the C++ implementation).
I did a first check but still need to go through most of the Cython code and all the tests.
As for the C++ permutation change - maybe that also fits better into a separate issue&PR?
|
Thanks for the quick review @AlenkaF ! I addressed your comments, please do another pass whenever you can. Regarding the C++ permutation change - I'll think about it a bit more and perhaps really spin it out. Again, I'm not entirely sure what to do yet, but it doesn't change the remainder of the review. |
Rationale for this change
Once C++ implementation of VariableShapeTensor is complete (#38007) we want a Python wrapper for
VariableShapeTensor.What changes are included in this PR?
This adds a Python wrapper for
VariableShapeTensor.Are these changes tested?
This adds appropriate Python tests.
Are there any user-facing changes?
Yes, a new extension and array type are exposed.