class_docstr: SAB block from `Set Transformer: A Framework for Attention-based
  Permutation-Invariant Neural Networks <https://arxiv.org/abs/1810.00825>`__
  
  Parameters
  ----------
  d_model : int
      The feature size (input and output) in Multi-Head Attention layer.
  num_heads : int
      The number of heads.
  d_head : int
      The hidden size per head.
  d_ff : int
      The inner hidden size in the Feed-Forward Neural Network.
  dropouth : float
      The dropout rate of each sublayer.
  dropouta : float
      The dropout rate of attention heads.
  
  Notes
  -----
  This module was used in SetTransformer layer.
class_docstr_tok: ["SAB","block","from","`","Set","Transformer",":","A","Framework","for","Attention-based","Permutation-Invariant","Neural","Networks","<","https",":","\/\/arxiv.org\/abs\/1810.00825",">","`","__","Parameters","--","--","--","--","--","d_model",":","int","The","feature","size","(","input","and","output",")","in","Multi-Head","Attention","layer",".","num_heads",":","int","The","number","of","heads",".","d_head",":","int","The","hidden","size","per","head",".","d_ff",":","int","The","inner","hidden","size","in","the","Feed-Forward","Neural","Network",".","dropouth",":","float","The","dropout","rate","of","each","sublayer",".","dropouta",":","float","The","dropout","rate","of","attention","heads",".","Notes","--","--","-","This","module","was","used","in","SetTransformer","layer","."]
docstr: Compute a Set Attention Block.
  
  Parameters
  ----------
  feat : torch.Tensor
      The input feature.
  lengths : list
      The array of node numbers, used to segment feat tensor.
docstr_tok: ["Compute","a","Set","Attention","Block",".","Parameters","--","--","--","--","--","feat",":","torch.Tensor","The","input","feature",".","lengths",":","list","The","array","of","node","numbers",",","used","to","segment","feat","tensor","."]
code: def forward(self, feat, lengths):
      """
      Compute a Set Attention Block.
  
      Parameters
      ----------
      feat : torch.Tensor
          The input feature.
      lengths : list
          The array of node numbers, used to segment feat tensor.
      """
      return self.mha(feat, feat, lengths, lengths)
  
imports: import numpy
  import torch
  import torch.nn
  from ...backend import pytorch
  from ...base import dgl_warning
  from ...readout import broadcast_nodes, max_nodes, mean_nodes, softmax_nodes, sum_nodes, topk_nodes
label_desc: Use image node_id 2 for calling the SetAttentionBlock obj's underlying member method code with example usage: obj.forward(feat, lengths) and returns: self