class_docstr: The GNN-Explainer model from the `"GNNExplainer: Generating
  Explanations for Graph Neural Networks"
  <https://arxiv.org/abs/1903.03894>`_ paper for identifying compact subgraph
  structures and node features that play a crucial role in the predictions
  made by a GNN.
  
  .. note::
  
      For an example of using :class:`GNNExplainer`, see
      `examples/explain/gnn_explainer.py <https://github.com/pyg-team/
      pytorch_geometric/blob/master/examples/explain/gnn_explainer.py>`_,
      `examples/explain/gnn_explainer_ba_shapes.py <https://github.com/
      pyg-team/pytorch_geometric/blob/master/examples/
      explain/gnn_explainer_ba_shapes.py>`_, and `examples/explain/
      gnn_explainer_link_pred.py <https://github.com/pyg-team/
      pytorch_geometric/blob/master/examples/explain/gnn_explainer_link_pred.py>`_.
  
  .. note::
  
      The :obj:`edge_size` coefficient is multiplied by the number of nodes
      in the explanation at every iteration, and the resulting value is added
      to the loss as a regularization term, with the goal of producing
      compact explanations.
      A higher value will push the algorithm towards explanations with less
      elements.
      Consider adjusting the :obj:`edge_size` coefficient according to the
      average node degree in the dataset, especially if this value is bigger
      than in the datasets used in the original paper.
  
  Args:
      epochs (int, optional): The number of epochs to train.
          (default: :obj:`100`)
      lr (float, optional): The learning rate to apply.
          (default: :obj:`0.01`)
      **kwargs (optional): Additional hyper-parameters to override default
          settings in
          :attr:`~torch_geometric.explain.algorithm.GNNExplainer.coeffs`.
code: def _clean_model(self, model):
      clear_masks(model)
      self.node_mask = self.hard_node_mask = None
      self.edge_mask = self.hard_edge_mask = None
  
imports: from math import sqrt
  from typing import Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch.nn.parameter import Parameter
  from torch_geometric.explain import ExplainerConfig, Explanation, ModelConfig
  from torch_geometric.explain.algorithm import ExplainerAlgorithm
  from torch_geometric.explain.algorithm.utils import clear_masks, set_masks
  from torch_geometric.explain.config import MaskType, ModelMode, ModelTaskLevel
label_desc: Use image node_id 7 for calling the GNNExplainer obj's underlying member method code with example usage: obj._clean_model(model) without return types