class_docstr: Performs readout on a batch of graph
  
  The readout module is used for performing readouts on batched graphs to
  convert node embeddings/edge embeddings into graph embeddings. It is used
  in the Grover architecture to generate a graph embedding from node and edge
  embeddings. The generate embedding can be used in downstream tasks like graph
  classification or graph prediction problems.
  
  Parameters
  ----------
  rtype: str
      Readout type, can be 'mean' or 'self-attention'
  in_features: int
      Size fof input features
  attn_hidden_size: int
      If readout type is attention, size of hidden layer in attention network.
  attn_out_size: int
      If readout type is attention, size of attention out layer.
  
  Example
  -------
  >>> import torch
  >>> from deepchem.models.torch_models.readout import GroverReadout
  >>> n_nodes, n_features = 6, 32
  >>> readout = GroverReadout(rtype="mean")
  >>> embedding = torch.ones(n_nodes, n_features)
  >>> result = readout(embedding, scope=[(0, 6)])
  >>> result.size()
  torch.Size([1, 32])
class_docstr_tok: ["Performs","readout","on","a","batch","of","graph","The","readout","module","is","used","for","performing","readouts","on","batched","graphs","to","convert","node","embeddings\/edge","embeddings","into","graph","embeddings",".","It","is","used","in","the","Grover","architecture","to","generate","a","graph","embedding","from","node","and","edge","embeddings",".","The","generate","embedding","can","be","used","in","downstream","tasks","like","graph","classification","or","graph","prediction","problems",".","Parameters","--","--","--","--","--","rtype",":","str","Readout","type",",","can","be","'mean","'","or","'self-attention'","in_features",":","int","Size","fof","input","features","attn_hidden_size",":","int","If","readout","type","is","attention",",","size","of","hidden","layer","in","attention","network",".","attn_out_size",":","int","If","readout","type","is","attention",",","size","of","attention","out","layer",".","Example","--","--","--","-",">",">",">","import","torch",">",">",">","from","deepchem.models.torch_models.readout","import","GroverReadout",">",">",">","n_nodes",",","n_features","=","6",",","32",">",">",">","readout","=","GroverReadout","(","rtype=","''","mean","''",")",">",">",">","embedding","=","torch.ones","(","n_nodes",",","n_features",")",">",">",">","result","=","readout","(","embedding",",","scope=","[","(","0",",","6",")","]",")",">",">",">","result.size","(",")","torch.Size","(","[","1",",","32","]",")"]
code: def __init__(
      self,
      rtype: str = "mean",
      in_features: int = 128,
      attn_hidden_size: int = 32,
      attn_out_size: int = 32,
  ):
      super(GroverReadout, self).__init__()
      self.cached_zero_vector = nn.Parameter(
          torch.zeros(in_features), requires_grad=False
      )
      self.rtype = rtype
      if rtype == "self_attention":
          self.attn = SelfAttention(
              hidden_size=attn_hidden_size,
              in_features=in_features,
              out_features=attn_out_size,
          )
  
imports: from typing import List
  from deepchem.models.torch_models.attention import SelfAttention
label_desc: Use image node_id 1 to create a new GroverReadout object from inherited base classes: nn with example: obj = GroverReadout(rtype, in_features, attn_hidden_size, attn_out_size)