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

Is there anyway to read the documentation? #24

Closed
Yonggie opened this issue Nov 18, 2021 · 2 comments
Closed

Is there anyway to read the documentation? #24

Yonggie opened this issue Nov 18, 2021 · 2 comments
Assignees

Comments

@Yonggie
Copy link

Yonggie commented Nov 18, 2021

Thanks for opensourcing such good contribution.
I wrote a test code like this:

import torch
import GCL.augmentors as A
aug=A.Compose([A.EdgeAdding(pe=0.4),A.FeatureDropout(pf=0.5)])
edge_index=torch.randint(0,10,(2,10)) 
x=torch.randn((10,128))
auged=aug(x,edge_index)
print(auged)

and it got this:

num_edges = edge_index.size()[1]
IndexError: tuple index out of range

It would be appreciated if anyone could help tell me how to read the documentation.

After I checked the code in add_edge function in functional.py, there could be a little problem with these piece of code:

def add_edge(edge_index: torch.Tensor, ratio: float) -> torch.Tensor:
    num_edges = edge_index.size()[1]
    num_nodes = edge_index.max().item() + 1
    num_add = int(num_edges * ratio)

    new_edge_index = torch.randint(0, num_nodes - 1, size=(2, num_add)).to(edge_index.device)
    edge_index = torch.cat([edge_index, new_edge_index], dim=1)
    
    # here it could be wrongly written. [0] might be removed.
    edge_index = sort_edge_index(edge_index)[0]


    return coalesce_edge_index(edge_index)[0]
@SXKDZ
Copy link
Contributor

SXKDZ commented Nov 20, 2021

Thanks for your suggestion. Currently our team is busy with final examination and PhD application. We will try to add documentation as much as possible in late December.

@SXKDZ
Copy link
Contributor

SXKDZ commented Mar 20, 2022

We have fixed this problem. Please check the develop branch.

@SXKDZ SXKDZ closed this as completed Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants