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

Function to convert ragged arrays into (Python) _lists_ of Tensors? #3265

Open
jpivarski opened this issue Oct 2, 2024 · 0 comments
Open
Labels
feature New feature or request

Comments

@jpivarski
Copy link
Member

Description of new feature

Similar to #3256 and #3257, another function that could help ML users is one that turns a ragged array into a simple Python list of tensors. Although the aggr functions in PyTorch-Geometric can use ak.parents_index from #3256 to do a segmented aggregation in one Python call, tools like PyTorch Cluster expect an explicit Python loop over each variable-sized list (e.g. a Python loop over events, calling a vectorized function to process each collection of particles in that event: they're "batched by event.")

Perhaps ak.Arraylist[torch.Tensor]? Or → DataLoader (batched by lists in the ragged array)?

Cc: @livaage, @GageDeZoort, @maxymnaumchyk, @ianna

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant