class_docstr: Deprecated version for :class:`GNNExplainer`.
code: def _convert_output(
      self, explanation, edge_index, index=None, x=None
  ):
      node_mask = explanation.get("node_mask")
      edge_mask = explanation.get("edge_mask")
  
      if node_mask is not None:
          node_mask_type = (
              self._explainer.explainer_config.node_mask_type
          )
          if node_mask_type in {
              MaskType.object,
              MaskType.common_attributes,
          }:
              node_mask = node_mask.view(-1)
  
      if edge_mask is None:
          if index is not None:
              _, edge_mask = self._explainer._get_hard_masks(
                  self.model, index, edge_index, num_nodes=x.size(0)
              )
              edge_mask = edge_mask.to(x.dtype)
          else:
              edge_mask = torch.ones(
                  edge_index.size(1), device=edge_index.device
              )
  
      return node_mask, edge_mask
  
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 5 for calling the GNNExplainer_ obj's underlying member method code with example usage: obj._convert_output(explanation, edge_index, index, x) and returns: node_mask,  edge_mask