code: def eval_related_pred(
      self,
      x: Tensor,
      edge_index: Tensor,
      edge_masks: List[Tensor],
      **kwargs,
  ):
      node_idx = kwargs.get("node_idx")
      node_idx = (
          0 if node_idx is None else node_idx
      )  # graph level: 0, node level: node_idx
      related_preds = []
  
      # change the mask from -inf ~ +inf into 0 ~ 1
      for ex_label, edge_mask in enumerate(edge_masks):
          if self.hard_edge_mask is not None:
              sparsity = 1.0 - (
                  edge_mask[self.hard_edge_mask] != 0
              ).sum() / edge_mask[self.hard_edge_mask].size(0)
          else:
              sparsity = 1.0 - (edge_mask != 0).sum() / edge_mask.size(
                  0
              )
  
          self.edge_mask.data = torch.ones(
              edge_mask.size(), device=self.device
          )
          ori_pred = self.model(x=x, edge_index=edge_index, **kwargs)
  
          self.edge_mask.data = edge_mask
          masked_pred = self.model(x=x, edge_index=edge_index, **kwargs)
  
          # mask out important elements for fidelity calculation
          self.edge_mask.data = 1.0 - edge_mask  # keep Parameter's id
          maskout_pred = self.model(
              x=x, edge_index=edge_index, **kwargs
          )
  
          # zero_mask
          self.edge_mask.data = torch.zeros(
              edge_mask.size(), device=self.device
          )
          zero_mask_pred = self.model(
              x=x, edge_index=edge_index, **kwargs
          )
  
          related_preds.append(
              {
                  "zero": zero_mask_pred[node_idx],
                  "masked": masked_pred[node_idx],
                  "maskout": maskout_pred[node_idx],
                  "origin": ori_pred[node_idx],
                  "sparsity": sparsity,
              }
          )
  
          # Adding proper activation function to the models' outputs.
          tmp_result_dict = {}
          for key, pred in related_preds[ex_label].items():
              if key in ["sparsity"]:
                  tmp_result_dict[key] = pred.item()
              else:
                  tmp_result_dict[key] = (
                      pred.reshape(-1).softmax(0)[ex_label].item()
                  )
          related_preds[ex_label] = tmp_result_dict
  
      self.__clear_masks__()
      return related_preds
  
imports: from typing import List, Tuple, Dict
  from math import sqrt
  import torch
  from torch import Tensor
  import torch.nn
  import matplotlib.pyplot
  import networkx
  from torch_geometric.nn import MessagePassing
  from torch_geometric.utils.loop import add_self_loops, remove_self_loops
  from torch_geometric.data import Data, Batch
  from torch_geometric.utils import to_networkx
  from ..models.utils import subgraph
  from rdkit import Chem
  from matplotlib.axes import Axes
  import numpy
  from ..models import GNNPool
label_desc: Use image node_id 11 for calling the ExplainerBase obj's underlying member method code with example usage: obj.eval_related_pred(x, edge_index, edge_masks) and returns: related_preds