snap-stanford / ogb

Benchmark datasets, data loaders, and evaluators for graph machine learning
https://ogb.stanford.edu
MIT License
1.89k stars 397 forks source link

Updating `AtomEncoder` to improve input consistency #431

Closed asarigun closed 1 year ago

asarigun commented 1 year ago

This pull request updates the AtomEncoder class to improve input consistency when working with complex input data.

In the original code, the full_atom_feature_dims list was used to determine the number of atoms for each element in the input x tensor. However, this may not be consistent with the actual number of atoms in the input tensor, which can lead to errors related to mismatched tensor shapes or indexing operations.

To address this issue, I updated the AtomEncoder class to take an additional argument num_atoms_list, which specifies the number of atoms for each element in the input tensor. This ensures that the correct number of atoms is used for each element, regardless of the complexity of the input data.

weihua916 commented 1 year ago

Hi! I am not sure if I understand and this will break the backward compatibility. the additional argument should at least be optional.

asarigun commented 1 year ago

Hi! I am not sure if I understand and this will break the backward compatibility. the additional argument should at least be optional.

Hi! Thank you for your feedback. I understand your concern about maintaining backward compatibility, and I agree that adding an optional argument for num_atoms_list would be a good solution.

I will make the necessary changes to my code and update the pull request accordingly. Please let me know if you have any further suggestions or concerns. Thank you for your time and attention.

weihua916 commented 1 year ago

Thanks! LGTM