class_docstr: Sort Pooling from `An End-to-End Deep Learning Architecture for Graph Classification
  <https://www.cse.wustl.edu/~ychen/public/DGCNN.pdf>`__
  
  Parameters
  ----------
  k : int
      The number of nodes to hold for each graph.
class_docstr_tok: ["Sort","Pooling","from","`","An","End-to-End","Deep","Learning","Architecture","for","Graph","Classification","<","https",":","\/\/www.cse.wustl.edu\/~ychen\/public\/DGCNN.pdf",">","`","__","Parameters","--","--","--","--","--","k",":","int","The","number","of","nodes","to","hold","for","each","graph","."]
docstr: Compute sort pooling.
  
  Parameters
  ----------
  graph : DGLGraph
      The graph.
  feat : tf.Tensor
      The input node feature with shape :math:`(N, D)` where
      :math:`N` is the number of nodes in the graph.
  
  Returns
  -------
  tf.Tensor
      The output feature with shape :math:`(B, k * D)`, where
      :math:`B` refers to the batch size.
docstr_tok: ["Compute","sort","pooling",".","Parameters","--","--","--","--","--","graph",":","DGLGraph","The","graph",".","feat",":","tf.Tensor","The","input","node","feature","with","shape",":","math",":","`","(","N",",","D",")","`","where",":","math",":","`","N","`","is","the","number","of","nodes","in","the","graph",".","Returns","--","--","--","-","tf.Tensor","The","output","feature","with","shape",":","math",":","`","(","B",",","k","*","D",")","`",",","where",":","math",":","`","B","`","refers","to","the","batch","size","."]
code: def call(self, graph, feat):
      r"""Compute sort pooling.
  
      Parameters
      ----------
      graph : DGLGraph
          The graph.
      feat : tf.Tensor
          The input node feature with shape :math:`(N, D)` where
          :math:`N` is the number of nodes in the graph.
  
      Returns
      -------
      tf.Tensor
          The output feature with shape :math:`(B, k * D)`, where
          :math:`B` refers to the batch size.
      """
      with graph.local_scope():
          # Sort the feature of each node in ascending order.
          feat = tf.sort(feat, -1)
          graph.ndata["h"] = feat
          # Sort nodes according to their last features.
          ret = tf.reshape(
              topk_nodes(graph, "h", self.k, sortby=-1)[0],
              (-1, self.k * feat.shape[-1]),
          )
          return ret
  
imports: import tensorflow
  from tensorflow.keras import layers
  from ...readout import max_nodes, mean_nodes, softmax_nodes, sum_nodes, topk_nodes
label_desc: Use image node_id 2 for calling the SortPooling obj's underlying member method code with example usage: obj.call(graph, feat) and returns: ret