docstr: Converts tuple of tensors to `x_dict`, `edge_index_dict` and
  `edge_mask_dict`.
docstr_tok: ["Converts","tuple","of","tensors","to","`","x_dict","`",",","`","edge_index_dict","`","and","`","edge_mask_dict","`","."]
code: def _captum_data_to_hetero_data(
      self, *args
  ) -> Tuple[
      Dict[NodeType, Tensor],
      Dict[EdgeType, Tensor],
      Optional[Dict[EdgeType, Tensor]],
  ]:
      """Converts tuple of tensors to `x_dict`, `edge_index_dict` and
      `edge_mask_dict`.
      """
      if self.mask_type == MaskLevelType.node:
          node_tensors = args[: self.num_node_types]
          node_tensors = [mask.squeeze(0) for mask in node_tensors]
          x_dict = dict(zip(self.node_types, node_tensors))
          edge_index_dict = args[self.num_node_types]
      elif self.mask_type == MaskLevelType.edge:
          edge_mask_tensors = args[: self.num_edge_types]
          x_dict = args[self.num_edge_types]
          edge_index_dict = args[self.num_edge_types + 1]
      else:
          node_tensors = args[: self.num_node_types]
          node_tensors = [mask.squeeze(0) for mask in node_tensors]
          x_dict = dict(zip(self.node_types, node_tensors))
          edge_mask_tensors = args[
              self.num_node_types : self.num_node_types
              + self.num_edge_types
          ]
          edge_index_dict = args[
              self.num_node_types + self.num_edge_types
          ]
  
      if self.mask_type.with_edge:
          edge_mask_tensors = [
              mask.squeeze(0) for mask in edge_mask_tensors
          ]
          edge_mask_dict = dict(zip(self.edge_types, edge_mask_tensors))
      else:
          edge_mask_dict = None
      return x_dict, edge_index_dict, edge_mask_dict
  
imports: from enum import Enum
  from typing import Dict, Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch_geometric.explain.algorithm.utils import clear_masks, set_hetero_masks, set_masks
  from torch_geometric.explain.config import ModelConfig, ModelMode, ModelReturnType
  from torch_geometric.typing import EdgeType, Metadata, NodeType
label_desc: Use image node_id 2 for calling the CaptumHeteroModel obj's underlying member method code with example usage: obj._captum_data_to_hetero_data() and returns: x_dict,  edge_index_dict,  edge_mask_dict