class_docstr: An abstract base class for implementing explainer algorithms.
docstr: Returns the number of hops the :obj:`model` is aggregating
  information from.
docstr_tok: ["Returns","the","number","of","hops","the",":","obj",":","`","model","`","is","aggregating","information","from","."]
code: def _num_hops(model: torch.nn.Module) -> int:
      r"""Returns the number of hops the :obj:`model` is aggregating
      information from.
      """
      num_hops = 0
      for module in model.modules():
          if isinstance(module, MessagePassing):
              num_hops += 1
      return num_hops
  
imports: from abc import abstractmethod
  from typing import Dict, Optional, Tuple, Union
  import torch
  import torch.nn.functional
  from torch import Tensor
  from torch_geometric.explain import Explanation, HeteroExplanation
  from torch_geometric.explain.config import ExplainerConfig, ModelConfig, ModelReturnType
  from torch_geometric.nn import MessagePassing
  from torch_geometric.typing import EdgeType, NodeType
  from torch_geometric.utils import k_hop_subgraph
label_desc: Use image node_id 8 for calling the ExplainerAlgorithm obj's underlying member method code with example usage: obj._num_hops(model) and returns: num_hops