class_docstr: Graph Information Network (GIN) encoder. This is a graph convolutional network that produces encoded representations for molecular graph inputs.
  
  Parameters
  ----------
  num_features: int
      The number of node features
  embedding_dim: int
      The dimension of the output embedding
  num_gc_layers: int, optional (default 5)
      The number of graph convolutional layers to use
  
  Example
  -------
  >>> import numpy as np
  >>> from deepchem.models.torch_models.infograph import GINEncoder
  >>> from deepchem.feat.graph_data import GraphData
  >>> encoder = GINEncoder(num_features=25, embedding_dim=32)
  >>> node_features = np.random.randn(10, 25)
  >>> edge_index = np.array([[0, 1, 2], [1, 2, 3]])
  >>> edge_features = np.random.randn(3, 10)
  >>> graph_index = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
  >>> data = GraphData(node_features=node_features, edge_index=edge_index, edge_features=edge_features, graph_index=graph_index).numpy_to_torch()
  >>> embedding, intermediate_embeddings = encoder(data)
  >>> print(embedding.shape)
  torch.Size([1, 30])
  
  References
  ----------
  .. [1] Xu, K., Hu, W., Leskovec, J. & Jegelka, S. How Powerful are Graph Neural Networks? arXiv:1810.00826 [cs, stat] (2019).
docstr: Encodes the input graph data.
  
  Parameters
  ----------
  data : BatchGraphData
      The batched input graph data.
  
  Returns
  -------
  Tuple[torch.Tensor, torch.Tensor]
      A tuple containing the encoded representation and intermediate embeddings.
docstr_tok: ["Encodes","the","input","graph","data",".","Parameters","--","--","--","--","--","data",":","BatchGraphData","The","batched","input","graph","data",".","Returns","--","--","--","-","Tuple","[","torch.Tensor",",","torch.Tensor","]","A","tuple","containing","the","encoded","representation","and","intermediate","embeddings","."]
code: def forward(self, data):
      """
      Encodes the input graph data.
  
      Parameters
      ----------
      data : BatchGraphData
          The batched input graph data.
  
      Returns
      -------
      Tuple[torch.Tensor, torch.Tensor]
          A tuple containing the encoded representation and intermediate embeddings.
      """
      xs = []
      x = data.node_features
      for i in range(self.num_gc_layers):
          x = F.relu(self.convs[i](x, data.edge_index))
          x = self.bns[i](x)
          xs.append(x)
  
      xpool = [global_add_pool(x, data.graph_index) for x in xs]
      x = torch.cat(xpool, 1)
      xs = torch.cat(xs, 1)
      return x, xs
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn import GRU, Linear, ReLU, Sequential
  from typing import Iterable, List, Tuple, Optional, Dict, Literal
  from deepchem.metrics import to_one_hot
  import deepchem
  from deepchem.models.losses import SoftmaxCrossEntropy
  from deepchem.feat.graph_data import BatchGraphData
  from deepchem.models.losses import GlobalMutualInformationLoss, LocalMutualInformationLoss
  from deepchem.models.torch_models.layers import MultilayerPerceptron
  from deepchem.models.torch_models.modular import ModularTorchModel
label_desc: Use image node_id 2 for calling the GINEncoder obj's underlying member method code with example usage: obj.forward(data) and returns: x,  xs