pytorch_geometric icon indicating copy to clipboard operation
pytorch_geometric copied to clipboard

Add `DensePaddingDataLoader` for flexible (padded) dense batching of `BaseData` objects

Open amorehead opened this issue 2 years ago • 7 comments

🚀 The new functionality, motivation and pitch

  • This PR adds a new DensePaddingDataLoader class that enables flexible dense batching of BaseData objects.
  • Such functionality supports fast and direct conversion of PyG Data or HeteroData objects into CV/NLP-driven (dense-batching) model training pipelines.

Alternatives

No alternatives exist for this functionality, including PyG's DenseDataLoader which assumes each (sub)graph's node count must be identical to all other (sub)graphs.

Additional context

This new data loader enables one to easily experiment with message passing algorithms that operate on dense tensor representations of batched graph objects without having to redesign one's PyG-driven Dataset class. This idea was initiated per https://github.com/pyg-team/pytorch_geometric/discussions/8516 and raised as an issue in https://github.com/pyg-team/pytorch_geometric/issues/8517.

amorehead avatar Dec 04 '23 03:12 amorehead

Codecov Report

Attention: Patch coverage is 0% with 169 lines in your changes are missing coverage. Please review.

Project coverage is 89.08%. Comparing base (2fcd29d) to head (6cef254). Report is 2 commits behind head on master.

Files Patch % Lines
...orch_geometric/loader/dense_padding_data_loader.py 0.00% 169 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8518      +/-   ##
==========================================
- Coverage   90.02%   89.08%   -0.94%     
==========================================
  Files         470      471       +1     
  Lines       30164    30333     +169     
==========================================
- Hits        27154    27022     -132     
- Misses       3010     3311     +301     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Dec 04 '23 03:12 codecov[bot]