code: def testGroverFunctionalGroupPredictor():
      from deepchem.models.torch_models.grover_layers import (
          GroverFunctionalGroupPredictor,
      )
  
      in_features, functional_group_size = 8, 20
      num_atoms, num_bonds = 10, 20
      predictor = GroverFunctionalGroupPredictor(
          functional_group_size=20, in_features=8
      )
      # In a batched graph, atoms and bonds belonging to different graphs are differentiated
      # via scopes. In the below scenario, we assume a batched mol graph of three molecules
      # with 10 atoms, 20 bonds. On the 10 atoms, we consider the first 3 belonging to mol1,
      # next 3 belonging to mol2 and remaining 4 belonging to mol4.
      # Hence, the atom scope is [(0, 3), (3, 3), (6, 4)]. Similarly, for bonds, we have first 5 bonds belonging to mol1, next 4 to mol2 and remaining 11 to bond3.
      atom_scope, bond_scope = [(0, 3), (3, 3), (6, 4)], [
          (0, 5),
          (5, 4),
          (9, 11),
      ]
      embeddings = {}
      embeddings["bond_from_atom"] = torch.randn(num_bonds, in_features)
      embeddings["bond_from_bond"] = torch.randn(num_bonds, in_features)
      embeddings["atom_from_atom"] = torch.randn(num_atoms, in_features)
      embeddings["atom_from_bond"] = torch.randn(num_atoms, in_features)
  
      result = predictor(embeddings, atom_scope, bond_scope)
      assert result["bond_from_bond"].shape == (
          len(bond_scope),
          functional_group_size,
      )
      assert result["bond_from_atom"].shape == (
          len(bond_scope),
          functional_group_size,
      )
      assert result["atom_from_atom"].shape == (
          len(atom_scope),
          functional_group_size,
      )
      assert result["atom_from_bond"].shape == (
          len(atom_scope),
          functional_group_size,
      )
  
file_path: deepchem/deepchem/models/torch_models/tests/test_grover_layers.py
imports: import pytest
label_desc: Use image node_id 4 for calling a global function with example usage: testGroverFunctionalGroupPredictor() without return types