class_docstr: An explainer that uses the attention coefficients produced by an
  attention-based GNN (*e.g.*,
  :class:`~torch_geometric.nn.conv.GATConv`,
  :class:`~torch_geometric.nn.conv.GATv2Conv`, or
  :class:`~torch_geometric.nn.conv.TransformerConv`) as edge explanation.
  Attention scores across layers and heads will be aggregated according to
  the :obj:`reduce` argument.
  
  Args:
      reduce (str, optional): The method to reduce the attention scores
          across layers and heads. (default: :obj:`"max"`)
class_docstr_tok: ["An","explainer","that","uses","the","attention","coefficients","produced","by","an","attention-based","GNN","(","*","e.g",".","*",",",":","class",":","`","~torch_geometric.nn.conv.GATConv","`",",",":","class",":","`","~torch_geometric.nn.conv.GATv2Conv","`",",","or",":","class",":","`","~torch_geometric.nn.conv.TransformerConv","`",")","as","edge","explanation",".","Attention","scores","across","layers","and","heads","will","be","aggregated","according","to","the",":","obj",":","`","reduce","`","argument",".","Args",":","reduce","(","str",",","optional",")",":","The","method","to","reduce","the","attention","scores","across","layers","and","heads",".","(","default",":",":","obj",":","`","``","max","''","`",")"]
code: def __init__(self, reduce: str = "max"):
      super().__init__()
      self.reduce = reduce
  
file_path: pytorch_geometric/torch_geometric/explain/algorithm/attention_explainer.py
imports: import logging
  from typing import List, Optional, Union
  import torch
  from torch import Tensor
  from torch_geometric.explain import Explanation
  from torch_geometric.explain.algorithm import ExplainerAlgorithm
  from torch_geometric.explain.config import ExplanationType, ModelTaskLevel
  from torch_geometric.nn.conv.message_passing import MessagePassing
label_desc: Use image node_id 1 to create a new AttentionExplainer object from inherited base classes: ExplainerAlgorithm with example: obj = AttentionExplainer(reduce)