class_docstr: A plain python object modeling a heterogeneous graph with various
  attributes (Node types in :class:`HeteroGraph` require string type).
  
  Args:
      G (:class:`networkx.classes.graph`): A NetworkX graph object which
          contains features and labels for each node type and edge type.
      **kwargs: Keyworded argument list with keys such
          as :obj:`"node_feature"`, :obj:`"node_label"` and
          corresponding attributes.
class_docstr_tok: ["A","plain","python","object","modeling","a","heterogeneous","graph","with","various","attributes","(","Node","types","in",":","class",":","`","HeteroGraph","`","require","string","type",")",".","Args",":","G","(",":","class",":","`","networkx.classes.graph","`",")",":","A","NetworkX","graph","object","which","contains","features","and","labels","for","each","node","type","and","edge","type",".","*","*","kwargs",":","Keyworded","argument","list","with","keys","such","as",":","obj",":","`","``","node_feature","''","`",",",":","obj",":","`","``","node_label","''","`","and","corresponding","attributes","."]
docstr: Returns specified type of index tensor.
  
  Args:
      index(tensor): the index tensor you want to transform.
      mapping_type(string): specify which mapping node or edge.
  
  Returns:
      index tensor.
docstr_tok: ["Returns","specified","type","of","index","tensor",".","Args",":","index","(","tensor",")",":","the","index","tensor","you","want","to","transform",".","mapping_type","(","string",")",":","specify","which","mapping","node","or","edge",".","Returns",":","index","tensor","."]
code: def _convert_to_tensor_index(self, index: int, mapping_type="node"):
      r"""
      Returns specified type of index tensor.
  
      Args:
          index(tensor): the index tensor you want to transform.
          mapping_type(string): specify which mapping node or edge.
  
      Returns:
          index tensor.
      """
      if mapping_type == "node":
          mapping = self.node_to_tensor_mapping
      elif mapping_type == "edge":
          mapping = self.edge_to_tensor_mapping
      else:
          raise ValueError("Mapping type should be node or edge.")
      return torch.index_select(mapping, 0, index)
  
imports: import math
  import copy
  import random
  import torch
  import networkx
  import numpy
  from deepsnap.graph import Graph
  from typing import Dict, List, Union
  import warnings
label_desc: Use image node_id 14 for calling the HeteroGraph obj's underlying member method code with example usage: obj._convert_to_tensor_index(index, mapping_type) and returns: torch