Add `from_data` builder method to `Batch` that accepts batched data.
See original GitHub issue🚀 The feature, motivation and pitch
PyG currently offers only one method for creating Batch
objects, namely from_data_list
. This method takes a list of BaseData
objects as input. However, there are settings, such as Reinforcement Learning, where it is commonplace to process data that is already batched, e.g. using stable_baselines3
SubprocVecEnv. In these settings, it becomes necessary to unbatch the data and subsequently re-batch it using from_data_list
. It would be helpful if there was a method that accepted already batched data in order to create Batch
objects.
Alternatives
Currently our best alternatives are un-batching and re-batching, as described above, or overriding the methods in SubprocVecEnv
.
Additional context
I am willing to work on a Pull Request for this.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Batch Processing in Spring Boot Simplified 101 - Learn | Hevo
The StepBuilderFactory class generates a batch step. The batch steps will be executed by the batch job. Batch jobs such as ItemReader, ...
Read more >Adding batch or bulk endpoints to your REST API - Codementor
A comprehensive guide on what batch endpoints are, why they're useful, and how they can be added to existing REST APIs.
Read more >Sending records in batches - Algolia
Go to your dashboard, select the Data Sources icon and then select your index. · Click the Add records tab and select Add...
Read more >Data Collator - Hugging Face
Data collators are objects that will form a batch by using a list of dataset elements as input. These elements are of the...
Read more >Efficient way to do batch INSERTS with JDBC - Stack Overflow
This is a mix of the two previous answers: PreparedStatement ps = c.prepareStatement("INSERT INTO employees VALUES (?, ?)"); ps.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For
x
, we reshaped with the padding as the padded nodes will not induce message passing since they are disjoint from the rest of the graphs. Foredge_index
, we used theinc
tensor you suggested, and we removed the padded edges with boolean indexing. A similar approach was used foredge_attr
.The code that we used is as follows:
For
separate()
, since we only needed the nodes, we just reshapedx
back to the original shape.Thanks for your help in this issue!
Hi @rusty1s a member of my team came up with a solution to this based on what you wrote. We will be sharing shortly. Thanks for your help!