Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 16, 2022
1 parent 3834a7d commit 0d0ac96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
5 changes: 1 addition & 4 deletions torch_geometric/datasets/motif_generator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@
from .cycle import CycleMotif

__all__ = classes = [
'MotifGenerator',
'CustomMotif',
'HouseMotif',
'CycleMotif'
'MotifGenerator', 'CustomMotif', 'HouseMotif', 'CycleMotif'
]
9 changes: 4 additions & 5 deletions torch_geometric/datasets/motif_generator/cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ class CycleMotif(CustomMotif):
Generating Explanations for Graph Neural Networks"
<https://arxiv.org/pdf/1903.03894.pdf>`_ paper, containing n nodes and n
undirected edges.
Args:
n (int): Number of nodes (or edges) in the cycle.
"""
def __init__(self, n: int = 6):
# construct edge_index based on n
structure = Data(
num_nodes=n,
edge_index=torch.Tensor([
[x for x in range(n)],
[y for y in range(1, n)] + [0]
]).type(torch.int32),
edge_index=torch.Tensor([[x for x in range(n)],
[y for y in range(1, n)] + [0]
]).type(torch.int32),
)
super().__init__(structure)

0 comments on commit 0d0ac96

Please sign in to comment.