class_docstr: A SortPool layer as described by
  [Zhang et al](https://www.cse.wustl.edu/~muhan/papers/AAAI_2018_DGCNN.pdf).
  This layers takes a graph signal \(\mathbf{X}\) and returns the topmost k
  rows according to the last column.
  If \(\mathbf{X}\) has less than k rows, the result is zero-padded to k.
  
  **Mode**: single, disjoint, batch.
  
  **Input**
  
  - Node features of shape `([batch], n_nodes, n_node_features)`;
  - Graph IDs of shape `(n_nodes, )` (only in disjoint mode);
  
  **Output**
  
  - Pooled node features of shape `(batch, k, n_node_features)` (if single mode, shape will
  be `(1, k, n_node_features)`).
  
  **Arguments**
  
  - `k`: integer, number of nodes to keep;
class_docstr_tok: ["A","SortPool","layer","as","described","by","[","Zhang","et","al","]","(","https",":","\/\/www.cse.wustl.edu\/~muhan\/papers\/AAAI_2018_DGCNN.pdf",")",".","This","layers","takes","a","graph","signal","\\","(","\\mathbf","{","X","}","\\",")","and","returns","the","topmost","k","rows","according","to","the","last","column",".","If","\\","(","\\mathbf","{","X","}","\\",")","has","less","than","k","rows",",","the","result","is","zero-padded","to","k.","*","*","Mode","*","*",":","single",",","disjoint",",","batch",".","*","*","Input","*","*","-","Node","features","of","shape","`","(","[","batch","]",",","n_nodes",",","n_node_features",")","`",";","-","Graph","IDs","of","shape","`","(","n_nodes",",",")","`","(","only","in","disjoint","mode",")",";","*","*","Output","*","*","-","Pooled","node","features","of","shape","`","(","batch",",","k",",","n_node_features",")","`","(","if","single","mode",",","shape","will","be","`","(","1",",","k",",","n_node_features",")","`",")",".","*","*","Arguments","*","*","-","`","k","`",":","integer",",","number","of","nodes","to","keep",";"]
code: def build(self, input_shape):
      if isinstance(input_shape, list) and len(input_shape) == 2:
          self.data_mode = "disjoint"
          self.F = input_shape[0][-1]
      else:
          if len(input_shape) == 2:
              self.data_mode = "single"
          else:
              self.data_mode = "batch"
          self.F = input_shape[-1]
  
imports: import tensorflow
  from tensorflow.keras import backend
  from tensorflow.keras import constraints, initializers, regularizers
  from tensorflow.keras.layers import Dense, Layer
  from spektral.layers import ops
label_desc: Use image node_id 2 for calling the SortPool obj's underlying member method code with example usage: obj.build(input_shape) without return types