code: def test_infographencoder():
      import numpy as np
      import torch
      from deepchem.models.torch_models.infograph import (
          InfoGraphEncoder,
      )
      from deepchem.feat.graph_data import GraphData, BatchGraphData
  
      torch.manual_seed(123)
      embedding_dim = 32
      num_nodes = 10
      num_graphs = 3
      encoder = InfoGraphEncoder(
          num_features=25, edge_features=10, embedding_dim=embedding_dim
      )
  
      data = []
      for i in range(num_graphs):
          node_features = np.random.randn(num_nodes, 25)
          edge_index = np.array([[0, 1, 2], [1, 2, 3]])
          edge_features = np.random.randn(3, 10)
  
          data.append(
              GraphData(
                  node_features=node_features,
                  edge_index=edge_index,
                  edge_features=edge_features,
              )
          )
      data = BatchGraphData(data).numpy_to_torch()
  
      embedding, feature_map = encoder(data)
  
      assert embedding.shape == torch.Size(
          [num_graphs, 2 * embedding_dim]
      )
      assert feature_map.shape == torch.Size(
          [num_nodes * num_graphs, embedding_dim]
      )
  
imports: import os
  import pytest
  import numpy
  import deepchem
  from deepchem.feat.molecule_featurizers import MolGraphConvFeaturizer
label_desc: Use image node_id 5 for calling a global function with example usage: test_infographencoder() without return types