Skip to content
Discussion options

You must be logged in to vote

You can either do:

x = x.mean(dim=0, keepdim=True) if batch is None else global_mean_pool(x, batch)

or do

if batch is None:
    batch = torch.zeros(x.size(0), dtype=torch.long, device=x.device)
x = global_mean_pool(x, batch)

Note that this is already fixed in later PyG versions.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@scottshufe
Comment options

Answer selected by scottshufe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants