-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat: to/from PyTorch JaggedTensor #3246
feat: to/from PyTorch JaggedTensor #3246
Conversation
…tensor-functions' into maxymnaumchyk/add-to-from-jaggedtensor-functions # Conflicts: # src/awkward/operations/ak_to_jaggedtensor.py
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
|
@jpivarski should I also leave out a "keep_regular" parameter since it does the same as ak.from_regular()? It's kind of the same situation we talked about today (about "padded" parameter). |
You're right: it is. The situation is that we should be providing an interface to the user that's like Lego bricks that they can put together however they like. If there's an alternative way of doing something, it shouldn't be a feature of the new functions, because then we'd have to explain why someone would use one or the other. I agree that the |
thanks for such a detailed answer! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great work! But it might be solving the wrong problem. As we discussed at the meeting, this fbgemm-gpu-cpu
module is not something ML users seem to be familiar with, so adding to/from functions wouldn't help them. It doesn't seem to be the interface that they use to implement DeepSets and GNNs, the ML models that might actually involve ragged data. So we're going to follow-up with ML experts to find out what interfaces they really do need.
Meanwhile, as discussed at the meeting, you'll be adding
ak.to_torch
usingContent.to_backend_array
ak.from_torch
for rectilinear arrays only (allow_record=False
and allow_missing=False
, following ak_to_numpy.py).
Another two functions,
ak.parents_index
withaxis
#3256ak.records_to_regular
to convert[{"x": 1, "y": 2}, {"x": 3, "y": 4}]
into[[1, 2], [3, 4]]
#3257
would be needed to pre-process an idiomatic Awkward Array into the kind of interface that PyTorch-Geometric needs, which isn't one RaggedTensor object like TensorFlow; it's a few, separate, completely rectilinear arrays. "The way to do it" needs to be explained as a User Guide that puts all of these functions together, rather than a single function that tries to do everything in one call.
Although I'm setting this to "request changes," we'll likely be closing this PR and following up with new ones.
I think this one was closed in favor of another. This was the implementation that converted to and from a data type that users of PyTorch are not familiar with. |
No description provided.