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

Update the collate_fn for PYGGraphTransformer #92

Closed
zhu0619 opened this issue Dec 4, 2023 · 2 comments · Fixed by #93
Closed

Update the collate_fn for PYGGraphTransformer #92

zhu0619 opened this issue Dec 4, 2023 · 2 comments · Fixed by #93
Labels
enhancement New feature or request

Comments

@zhu0619
Copy link
Contributor

zhu0619 commented Dec 4, 2023

Motivation

For the latest version of torch_geometric 2.4.0, the Collater was refactored and require an argument dataset.

Therefore, the current implementation of PYGGraphTransformer.get_collate_fn is no longer valid.

Pitch

The argument dataset should also be added in the get_collate_fn.

def get_collate_fn(
        self,
        dataset: Union[Dataset, Sequence[BaseData], DatasetAdapter],
        follow_batch: Optional[List[str]] = None,
        exclude_keys: Optional[List[str]] = None,
        return_pair: Optional[bool] = True,
        **kwargs,
    ):
        collator = Collater(dataset=dataset, follow_batch=follow_batch, exclude_keys=exclude_keys)
        return partial(self._collate_batch, collator=collator, return_pair=return_pair)

Additional context

No response

@zhu0619 zhu0619 added the enhancement New feature or request label Dec 4, 2023
@maclandrol
Copy link
Member

Thanks @zhu0619, can you make a PR ?

@zhu0619 zhu0619 linked a pull request Dec 6, 2023 that will close this issue
5 tasks
@maclandrol
Copy link
Member

@zhu0619, can you document the alternative of using the pyg DataLoader object directly somewhere ?

It allows actually not providing any collate function

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

Successfully merging a pull request may close this issue.

2 participants