class_docstr: Holds all the obtained explanations of a heterogeneous graph.
  
  The explanation object is a :obj:`~torch_geometric.data.HeteroData` object
  and can hold node attributions and edge attributions.
  It can also hold the original graph if needed.
docstr: Creates a bar plot of the node feature importances by summing up
  node masks across all nodes for each node type.
  
  Args:
      path (str, optional): The path to where the plot is saved.
          If set to :obj:`None`, will visualize the plot on-the-fly.
          (default: :obj:`None`)
      feat_labels (Dict[NodeType, List[str]], optional): The labels of
          features for each node type. (default :obj:`None`)
      top_k (int, optional): Top k features to plot. If :obj:`None`
          plots all features. (default: :obj:`None`)
docstr_tok: ["Creates","a","bar","plot","of","the","node","feature","importances","by","summing","up","node","masks","across","all","nodes","for","each","node","type",".","Args",":","path","(","str",",","optional",")",":","The","path","to","where","the","plot","is","saved",".","If","set","to",":","obj",":","`","None","`",",","will","visualize","the","plot","on-the-fly",".","(","default",":",":","obj",":","`","None","`",")","feat_labels","(","Dict","[","NodeType",",","List","[","str","]","]",",","optional",")",":","The","labels","of","features","for","each","node","type",".","(","default",":","obj",":","`","None","`",")","top_k","(","int",",","optional",")",":","Top","k","features","to","plot",".","If",":","obj",":","`","None","`","plots","all","features",".","(","default",":",":","obj",":","`","None","`",")"]
code: def visualize_feature_importance(
      self,
      path: Optional[str] = None,
      feat_labels: Optional[Dict[NodeType, List[str]]] = None,
      top_k: Optional[int] = None,
  ):
      r"""Creates a bar plot of the node feature importances by summing up
      node masks across all nodes for each node type.
  
      Args:
          path (str, optional): The path to where the plot is saved.
              If set to :obj:`None`, will visualize the plot on-the-fly.
              (default: :obj:`None`)
          feat_labels (Dict[NodeType, List[str]], optional): The labels of
              features for each node type. (default :obj:`None`)
          top_k (int, optional): Top k features to plot. If :obj:`None`
              plots all features. (default: :obj:`None`)
      """
      node_mask_dict = self.node_mask_dict
      for node_mask in node_mask_dict.values():
          if node_mask.dim() != 2 or node_mask.size(1) <= 1:
              raise ValueError(
                  f"Cannot compute feature importance for "
                  f"object-level 'node_mask' "
                  f"(got shape {node_mask_dict.size()})"
              )
  
      if feat_labels is None:
          feat_labels = {}
          for node_type, node_mask in node_mask_dict.items():
              feat_labels[node_type] = range(node_mask.size(1))
  
      score = torch.cat(
          [
              node_mask.sum(dim=0)
              for node_mask in node_mask_dict.values()
          ],
          dim=0,
      )
  
      all_feat_labels = []
      for node_type in node_mask_dict.keys():
          all_feat_labels += [
              f"{node_type}#{label}" for label in feat_labels[node_type]
          ]
  
      return _visualize_score(score, all_feat_labels, path, top_k)
  
imports: import copy
  from typing import Dict, List, Optional, Union
  import torch
  from torch import Tensor
  from torch_geometric.data.data import Data, warn_or_raise
  from torch_geometric.data.hetero_data import HeteroData
  from torch_geometric.explain.config import ThresholdConfig, ThresholdType
  from torch_geometric.typing import EdgeType, NodeType
  from torch_geometric.visualization import visualize_graph
label_desc: Use image node_id 5 for calling the HeteroExplanation obj's underlying member method code with example usage: obj.visualize_feature_importance(path, feat_labels, top_k) and returns: _visualize_score