parameters: (self, x_list, expands)
return_statement: return H[0][0]
docstring: Update node embeddings.
      Args:
        x_list: A list of list, representing input nodes and their K-hop neighbors.
          The first element x_list[0] is a list with one element which means root node tensor 
          with shape`[n, input_dim]`.
          The following element x_list[i] (i > 0) is i-th hop neighbors list with legth num_relations^i.
          It consists of different types of neighbors, and each element of x_list[i] is a tensor with 
          shape `[n * k_1 * ... * k_i, input_dim]`, where `k_i` means the neighbor count of each node 
          at i-th hop of root node. 
  
          Note that the elements of each list must be stored in the same order when stored 
          by relation type. For example, their are 2 relations and 2-hop neighbors, the x_list is stored
          in the following format:
          [[root_node], 
           [hop1_r1, hop1_r2], 
           [hop1_r1_hop2_r1, hop1_r1_hop2_r2, hop1_r2_hop2_r1, hop1_r2_hop2_r2]]
  
        expands: An integer list of neighbor count at each hop. For the above
          x_list, expands = [k_1, k_2, ... , k_K]
  
      Returns:
        A tensor with shape `[n, output_dim]`.
docstring_summary: Update node embeddings.
      Args:
        x_list: A list of list, representing input nodes and their K-hop neighbors.
          The first element x_list[0] is a list with one element which means root node tensor 
          with shape`[n, input_dim]`.
          The following element x_list[i] (i > 0) is i-th hop neighbors list with legth num_relations^i.
          It consists of different types of neighbors, and each element of x_list[i] is a tensor with 
          shape `[n * k_1 * ... * k_i, input_dim]`, where `k_i` means the neighbor count of each node 
          at i-th hop of root node.
docstring_tokens: Update node embeddings . Args : x_list : A list of list representing input nodes and their K - hop neighbors . The first element x_list [ 0 ] is a list with one element which means root node tensor with shape [ n input_dim ] . The following element x_list [ i ] ( i > 0 ) is i - th hop neighbors list with legth num_relations^i . It consists of different types of neighbors and each element of x_list [ i ] is a tensor with shape [ n * k_1 * ... * k_i input_dim ] where k_i means the neighbor count of each node at i - th hop of root node .
function: def forward(self, x_list, expands):
      """ Update node embeddings.
      Args:
        x_list: A list of list, representing input nodes and their K-hop neighbors.
          The first element x_list[0] is a list with one element which means root node tensor 
          with shape`[n, input_dim]`.
          The following element x_list[i] (i > 0) is i-th hop neighbors list with legth num_relations^i.
          It consists of different types of neighbors, and each element of x_list[i] is a tensor with 
          shape `[n * k_1 * ... * k_i, input_dim]`, where `k_i` means the neighbor count of each node 
          at i-th hop of root node. 
  
          Note that the elements of each list must be stored in the same order when stored 
          by relation type. For example, their are 2 relations and 2-hop neighbors, the x_list is stored
          in the following format:
          [[root_node], 
           [hop1_r1, hop1_r2], 
           [hop1_r1_hop2_r1, hop1_r1_hop2_r2, hop1_r2_hop2_r1, hop1_r2_hop2_r2]]
  
        expands: An integer list of neighbor count at each hop. For the above
          x_list, expands = [k_1, k_2, ... , k_K]
  
      Returns:
        A tensor with shape `[n, output_dim]`.
      """
      depth = len(expands)
      assert depth == (len(x_list) - 1)
      assert depth == len(self.layers)
  
      H = x_list
      for layer_idx in range(len(self.layers)): # for each conv layers.
        tmp_vecs = []
        num_root = 1 # the number of root node at each hop.
        for hop in range(depth - layer_idx): # for each hop neighbor, h[i+1]->h[i]
          tmp_nbr_vecs = []
          for offset in range(num_root): # do h[i+1]->h[i] according different relations.
            src_vecs = H[hop][offset]
            neigh_vecs = H[hop+1][(offset*self.num_relations) : ((offset+1)*self.num_relations)]
            h = self.layers[layer_idx].forward(src_vecs, neigh_vecs, expands[hop])
            if self.bn_func is not None:
              h = self.bn_func(h)
            if self.active_func is not None:
              h = self.active_func(h)
            if self.dropout and tfg.conf.training:
              h = tf.nn.dropout(h, keep_prob=1-self.dropout)
            tmp_nbr_vecs.append(h)
          num_root *= self.num_relations # the root node of the next hop is expand by num_relations.
          tmp_vecs.append(tmp_nbr_vecs)
        H = tmp_vecs
  
      return H[0][0]
function_tokens: def forward ( self , x_list , expands ) : depth = len ( expands ) assert depth == ( len ( x_list ) - 1 ) assert depth == len ( self . layers ) H = x_list for layer_idx in range ( len ( self . layers ) ) : # for each conv layers. tmp_vecs = [ ] num_root = 1 # the number of root node at each hop. for hop in range ( depth - layer_idx ) : # for each hop neighbor, h[i+1]->h[i] tmp_nbr_vecs = [ ] for offset in range ( num_root ) : # do h[i+1]->h[i] according different relations. src_vecs = H [ hop ] [ offset ] neigh_vecs = H [ hop + 1 ] [ ( offset * self . num_relations ) : ( ( offset + 1 ) * self . num_relations ) ] h = self . layers [ layer_idx ] . forward ( src_vecs , neigh_vecs , expands [ hop ] ) if self . bn_func is not None : h = self . bn_func ( h ) if self . active_func is not None : h = self . active_func ( h ) if self . dropout and tfg . conf . training : h = tf . nn . dropout ( h , keep_prob = 1 - self . dropout ) tmp_nbr_vecs . append ( h ) num_root *= self . num_relations # the root node of the next hop is expand by num_relations. tmp_vecs . append ( tmp_nbr_vecs ) H = tmp_vecs return H [ 0 ] [ 0 ]