diff --git a/autogl/module/model/pyg/robust/gnnguard.py b/autogl/module/model/pyg/robust/gnnguard.py index 3ccc969..8e83525 100644 --- a/autogl/module/model/pyg/robust/gnnguard.py +++ b/autogl/module/model/pyg/robust/gnnguard.py @@ -164,7 +164,7 @@ def att_coef(self, fea, edge_index, is_lil=False, i=0): def add_loop_sparse(self, adj, fill_value=1): # make identify sparse tensor - row = torch.range(0, int(adj.shape[0]-1), dtype=torch.int64) + row = torch.arange(0, adj.shape[0], dtype=torch.int64) i = torch.stack((row, row), dim=0) v = torch.ones(adj.shape[0], dtype=torch.float32) shape = adj.shape @@ -388,7 +388,7 @@ def forward(self, x, adj_lil): def add_loop_sparse(self, adj, fill_value=1): # make identify sparse tensor - row = torch.range(0, int(adj.shape[0]-1), dtype=torch.int64) + row = torch.arange(0, adj.shape[0], dtype=torch.int64) i = torch.stack((row, row), dim=0) v = torch.ones(adj.shape[0], dtype=torch.float32) shape = adj.shape diff --git a/autogl/module/nas/space/grna.py b/autogl/module/nas/space/grna.py index 919c666..ea5c116 100644 --- a/autogl/module/nas/space/grna.py +++ b/autogl/module/nas/space/grna.py @@ -390,7 +390,7 @@ def att_coef(self, fea, edge_index, is_lil=False, i=0): def add_loop_sparse(self, adj, fill_value=1): # make identify sparse tensor - row = torch.range(0, int(adj.shape[0]-1), dtype=torch.int64) + row = torch.arange(0, adj.shape[0], dtype=torch.int64) i = torch.stack((row, row), dim=0) v = torch.ones(adj.shape[0], dtype=torch.float32) shape = adj.shape