(self, graph: Graph)
| 20 | self.verbose = verbose |
| 21 | |
| 22 | def attack(self, graph: Graph): |
| 23 | if graph.test_mask is None or len(graph.test_nid) == 0: |
| 24 | print("index_target is None.") |
| 25 | exit(1) |
| 26 | adj_attack = self.modification(graph.to_scipy_csr(), graph.test_nid.cpu(), graph.y) |
| 27 | # graph = copy.deepcopy(graph) |
| 28 | # updateGraph(graph, adj_attack, graph.x) |
| 29 | # return graph |
| 30 | return getGraph(adj_attack, graph.x, graph.y, device=self.device) |
| 31 | |
| 32 | def modification(self, adj, index_target, labels): |
| 33 | adj_attack = adj.tolil() |