class_docstr: Implement a heterogeneous graph wrapper that creates a graph data holders
  that attributes and features in the heterogeneous graph.
  And we provide interface :code:`to_feed` to help converting :code:`Graph`
  data into :code:`feed_dict`.
  
  Args:
      name: The heterogeneous graph data prefix
  
      node_feat: A dict of list of tuples that decribe the details of node
                 feature tenosr. Each tuple mush be (name, shape, dtype)
                 and the first dimension of the shape must be set unknown
                 (-1 or None) or we can easily use :code:`HeterGraph.node_feat_info()`
                 to get the node_feat settings.
  
      edge_feat: A dict of list of tuples that decribe the details of edge
                 feature tenosr. Each tuple mush be (name, shape, dtype)
                 and the first dimension of the shape must be set unknown
                 (-1 or None) or we can easily use :code:`HeterGraph.edge_feat_info()`
                 to get the edge_feat settings.
                 
  Examples:
      .. code-block:: python
  
          import paddle.fluid as fluid
          import numpy as np
          from pgl import heter_graph
          from pgl import heter_graph_wrapper
          num_nodes = 4
          node_types = [(0, 'user'), (1, 'item'), (2, 'item'), (3, 'user')]
          edges = {
              'edges_type1': [(0,1), (3,2)],
              'edges_type2': [(1,2), (3,1)],
          }
          node_feat = {'feature': np.random.randn(4, 16)}
          edges_feat = {
              'edges_type1': {'h': np.random.randn(2, 16)},
              'edges_type2': {'h': np.random.randn(2, 16)},
          }
  
          g = heter_graph.HeterGraph(
                          num_nodes=num_nodes,
                          edges=edges,
                          node_types=node_types,
                          node_feat=node_feat,
                          edge_feat=edges_feat)
         
          gw = heter_graph_wrapper.HeterGraphWrapper(
                              name='heter_graph', 
                              edge_types = g.edge_types_info(),
                              node_feat=g.node_feat_info(),
                              edge_feat=g.edge_feat_info())
class_docstr_tok: ["Implement","a","heterogeneous","graph","wrapper","that","creates","a","graph","data","holders","that","attributes","and","features","in","the","heterogeneous","graph",".","And","we","provide","interface",":","code",":","`","to_feed","`","to","help","converting",":","code",":","`","Graph","`","data","into",":","code",":","`","feed_dict","`",".","Args",":","name",":","The","heterogeneous","graph","data","prefix","node_feat",":","A","dict","of","list","of","tuples","that","decribe","the","details","of","node","feature","tenosr",".","Each","tuple","mush","be","(","name",",","shape",",","dtype",")","and","the","first","dimension","of","the","shape","must","be","set","unknown","(","-1","or","None",")","or","we","can","easily","use",":","code",":","`","HeterGraph.node_feat_info","(",")","`","to","get","the","node_feat","settings",".","edge_feat",":","A","dict","of","list","of","tuples","that","decribe","the","details","of","edge","feature","tenosr",".","Each","tuple","mush","be","(","name",",","shape",",","dtype",")","and","the","first","dimension","of","the","shape","must","be","set","unknown","(","-1","or","None",")","or","we","can","easily","use",":","code",":","`","HeterGraph.edge_feat_info","(",")","`","to","get","the","edge_feat","settings",".","Examples",":","..","code-block",":",":","python","import","paddle.fluid","as","fluid","import","numpy","as","np","from","pgl","import","heter_graph","from","pgl","import","heter_graph_wrapper","num_nodes","=","4","node_types","=","[","(","0",",","'user","'",")",",","(","1",",","'item","'",")",",","(","2",",","'item","'",")",",","(","3",",","'user","'",")","]","edges","=","{","'edges_type1","'",":","[","(","0,1",")",",","(","3,2",")","]",",","'edges_type2","'",":","[","(","1,2",")",",","(","3,1",")","]",",","}","node_feat","=","{","'feature","'",":","np.random.randn","(","4",",","16",")","}","edges_feat","=","{","'edges_type1","'",":","{","'","h","'",":","np.random.randn","(","2",",","16",")","}",",","'edges_type2","'",":","{","'","h","'",":","np.random.randn","(","2",",","16",")","}",",","}","g","=","heter_graph.HeterGraph","(","num_nodes=num_nodes",",","edges=edges",",","node_types=node_types",",","node_feat=node_feat",",","edge_feat=edges_feat",")","gw","=","heter_graph_wrapper.HeterGraphWrapper","(","name='heter_graph","'",",","edge_types","=","g.edge_types_info","(",")",",","node_feat=g.node_feat_info","(",")",",","edge_feat=g.edge_feat_info","(",")",")"]
docstr: __getitem__
          
docstr_tok: ["__getitem__"]
code: def __getitem__(self, edge_type):
      """__getitem__"""
      return self._multi_gw[edge_type]
  
file_path: PGL/legacy/pgl/heter_graph_wrapper.py
imports: import warnings
  import numpy
  import paddle.fluid
  from pgl.utils import op
  from pgl.utils import paddle_helper
  from pgl.utils.logger import log
  from pgl.graph_wrapper import GraphWrapper
label_desc: Use image node_id 3 for calling the HeterGraphWrapper obj's underlying member method code with example usage: obj.__getitem__(edge_type) and returns: self