class_docstr: The Greedy Randomized Block Coordinate Descent (GRBCD) adversarial
  attack from the `Robustness of Graph Neural Networks at Scale
  <https://www.cs.cit.tum.de/daml/robustness-of-gnns-at-scale>`_ paper.
  
  GRBCD shares most of the properties and requirements with
  :class:`PRBCDAttack`. It also uses an efficient gradient based approach.
  However, it greedily flips edges based on the gradient towards the
  adjacency matrix.
  
  .. note::
      For examples of using the GRBCD Attack, see
      `examples/contrib/rbcd_attack.py
      <https://github.com/pyg-team/pytorch_geometric/blob/master/examples/
      contrib/rbcd_attack.py>`_
      for a test time attack (evasion).
  
  Args:
      model (torch.nn.Module): The GNN module to assess.
      block_size (int): Number of randomly selected elements in the
          adjacency matrix to consider.
      epochs (int, optional): Number of epochs (aborts early if
          :obj:`mode='greedy'` and budget is satisfied) (default: :obj:`125`)
      loss (str or callable, optional): A loss to quantify the "strength" of
          an attack. Note that this function must match the output format of
          :attr:`model`. By default, it is assumed that the task is
          classification and that the model returns raw predictions (*i.e.*,
          no output activation) or uses :obj:`logsoftmax`. Moreover, and the
          number of predictions should match the number of labels passed to
          :attr:`attack`. Either pass Callable or one of: :obj:`'masked'`,
          :obj:`'margin'`, :obj:`'prob_margin'`, :obj:`'tanh_margin'`.
          (default: :obj:`'masked'`)
      is_undirected (bool, optional): If :obj:`True` the graph is
          assumed to be undirected. (default: :obj:`True`)
      log (bool, optional): If set to :obj:`False`, will not log any learning
          progress. (default: :obj:`True`)
class_docstr_tok: ["The","Greedy","Randomized","Block","Coordinate","Descent","(","GRBCD",")","adversarial","attack","from","the","`","Robustness","of","Graph","Neural","Networks","at","Scale","<","https",":","\/\/www.cs.cit.tum.de\/daml\/robustness-of-gnns-at-scale",">","`","_","paper",".","GRBCD","shares","most","of","the","properties","and","requirements","with",":","class",":","`","PRBCDAttack","`",".","It","also","uses","an","efficient","gradient","based","approach",".","However",",","it","greedily","flips","edges","based","on","the","gradient","towards","the","adjacency","matrix",".","..","note",":",":","For","examples","of","using","the","GRBCD","Attack",",","see","`","examples\/contrib\/rbcd_attack.py","<","https",":","\/\/github.com\/pyg-team\/pytorch_geometric\/blob\/master\/examples\/","contrib\/rbcd_attack.py",">","`","_","for","a","test","time","attack","(","evasion",")",".","Args",":","model","(","torch.nn.Module",")",":","The","GNN","module","to","assess",".","block_size","(","int",")",":","Number","of","randomly","selected","elements","in","the","adjacency","matrix","to","consider",".","epochs","(","int",",","optional",")",":","Number","of","epochs","(","aborts","early","if",":","obj",":","`","mode='greedy","'","`","and","budget","is","satisfied",")","(","default",":",":","obj",":","`","125","`",")","loss","(","str","or","callable",",","optional",")",":","A","loss","to","quantify","the","``","strength","''","of","an","attack",".","Note","that","this","function","must","match","the","output","format","of",":","attr",":","`","model","`",".","By","default",",","it","is","assumed","that","the","task","is","classification","and","that","the","model","returns","raw","predictions","(","*","i.e",".","*",",","no","output","activation",")","or","uses",":","obj",":","`","logsoftmax","`",".","Moreover",",","and","the","number","of","predictions","should","match","the","number","of","labels","passed","to",":","attr",":","`","attack","`",".","Either","pass","Callable","or","one","of",":",":","obj",":","`","'masked","'","`",",",":","obj",":","`","'margin","'","`",",",":","obj",":","`","'prob_margin","'","`",",",":","obj",":","`","'tanh_margin","'","`",".","(","default",":",":","obj",":","`","'masked","'","`",")","is_undirected","(","bool",",","optional",")",":","If",":","obj",":","`","True","`","the","graph","is","assumed","to","be","undirected",".","(","default",":",":","obj",":","`","True","`",")","log","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","False","`",",","will","not","log","any","learning","progress",".","(","default",":",":","obj",":","`","True","`",")"]
docstr: Clean up and prepare return argument.
docstr_tok: ["Clean","up","and","prepare","return","argument","."]
code: def _close(self, *args, **kwargs) -> Tuple[Tensor, Tensor]:
      """Clean up and prepare return argument."""
      return self.edge_index, self.flipped_edges
  
imports: from collections import defaultdict
  from functools import partial
  from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
  import numpy
  import torch
  import torch.nn.functional
  from torch import Tensor
  from tqdm import tqdm
  from torch_geometric.utils import coalesce, to_undirected
label_desc: Use image node_id 4 for calling the GRBCDAttack obj's underlying member method code with example usage: obj._close() and returns: self,  self