class_docstr: Implementation of heterogeneous graph structure in pgl
  
  This is a simple implementation of heterogeneous graph structure in pgl.
  
  `pgl.HeterGraph` is an alias for `pgl.heter_graph.HeterGraph` 
  
  Args:
  
      edges: dict, every element in the dict is a list of (u, v) tuples or a 2D paddle.Tensor.
  
      num_nodes (optional): int, number of nodes in a heterogeneous graph
  
      node_types (optional): list of (u, node_type) tuples to specify the node type of every node
      node_feat (optional): a dict of numpy array as node features
  
      edge_feat (optional): a dict of dict as edge features for every edge type
  
  Examples:
      .. code-block:: python
  
          import numpy as np
          import pgl
  
          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 = pgl.HeterGraph(
                          num_nodes=num_nodes,
                          edges=edges,
                          node_types=node_types,
                          node_feat=node_feat,
                          edge_feat=edges_feat)
class_docstr_tok: ["Implementation","of","heterogeneous","graph","structure","in","pgl","This","is","a","simple","implementation","of","heterogeneous","graph","structure","in","pgl",".","`","pgl.HeterGraph","`","is","an","alias","for","`","pgl.heter_graph.HeterGraph","`","Args",":","edges",":","dict",",","every","element","in","the","dict","is","a","list","of","(","u",",","v",")","tuples","or","a","2D","paddle.Tensor",".","num_nodes","(","optional",")",":","int",",","number","of","nodes","in","a","heterogeneous","graph","node_types","(","optional",")",":","list","of","(","u",",","node_type",")","tuples","to","specify","the","node","type","of","every","node","node_feat","(","optional",")",":","a","dict","of","numpy","array","as","node","features","edge_feat","(","optional",")",":","a","dict","of","dict","as","edge","features","for","every","edge","type","Examples",":","..","code-block",":",":","python","import","numpy","as","np","import","pgl","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","=","pgl.HeterGraph","(","num_nodes=num_nodes",",","edges=edges",",","node_types=node_types",",","node_feat=node_feat",",","edge_feat=edges_feat",")"]
docstr: Convert the Heterogeneous Graph into numpy format.
  
  In numpy format, the graph edges and node features are in numpy.ndarray format.
  But you can't use send and recv in numpy graph.
  
  Args:
  
      inplace: (Default True) Whether to convert the graph into numpy inplace. 
docstr_tok: ["Convert","the","Heterogeneous","Graph","into","numpy","format",".","In","numpy","format",",","the","graph","edges","and","node","features","are","in","numpy.ndarray","format",".","But","you","ca","n't","use","send","and","recv","in","numpy","graph",".","Args",":","inplace",":","(","Default","True",")","Whether","to","convert","the","graph","into","numpy","inplace","."]
code: def numpy(self, inplace=True):
      """Convert the Heterogeneous Graph into numpy format.
  
      In numpy format, the graph edges and node features are in numpy.ndarray format.
      But you can't use send and recv in numpy graph.
  
      Args:
  
          inplace: (Default True) Whether to convert the graph into numpy inplace.
  
      """
      if not self._is_tensor:
          return self
  
      if inplace:
          for etype in self._edge_types:
              self._multi_graph[etype].numpy(inplace)
          self._is_tensor = False
          return self
      else:
          new_multi_graph = {}
          for etype in self._edge_types:
              new_multi_graph[etype] = self._multi_graph[etype].numpy(
                  inplace
              )
  
          new_graph = self.__class__(
              edges=None,
              node_types=self.__dict__["_node_types"],
              multi_graph=new_multi_graph,
          )
          return new_graph
  
imports: import os
  import json
  import paddle
  import copy
  import numpy
  import pickle
  from collections import defaultdict
  from pgl.graph import Graph
  from pgl.utils import op
  import pgl.graph_kernel
  from pgl.message import Message
label_desc: Use image node_id 21 for calling the HeterGraph obj's underlying member method code with example usage: obj.numpy(inplace) and returns: self, self, new_graph