class_docstr: The Grover Pretrain module.
  
  The GroverPretrain module is used for training an embedding based on the Grover Pretraining task.
  Grover pretraining is a self-supervised task where an embedding is trained to learn the contextual
  information of atoms and bonds along with graph-level properties, which are functional groups
  in case of molecular graphs.
  
  Parameters
  ----------
  embedding: nn.Module
      An embedding layer to generate embedding from input molecular graph
  atom_vocab_task_atom: nn.Module
      A layer used for predicting atom vocabulary from atom features generated via atom hidden states.
  atom_vocab_task_bond: nn.Module
      A layer used for predicting atom vocabulary from atom features generated via bond hidden states.
  bond_vocab_task_atom: nn.Module
      A layer used for predicting bond vocabulary from bond features generated via atom hidden states.
  bond_vocab_task_bond: nn.Module
      A layer used for predicting bond vocabulary from bond features generated via bond hidden states.
  
  Returns
  -------
  prediction_logits: Tuple
      A tuple of prediction logits containing prediction logits of atom vocabulary task from atom hidden state,
  prediction logits for atom vocabulary task from bond hidden states, prediction logits for bond vocabulary task
  from atom hidden states, prediction logits for bond vocabulary task from bond hidden states, functional
  group prediction logits from atom embedding generated from atom and bond hidden states, functional group
  prediction logits from bond embedding generated from atom and bond hidden states.
  
  Example
  -------
  >>> import deepchem as dc
  >>> from deepchem.utils.grover import BatchGroverGraph
  >>> from deepchem.models.torch_models.grover import GroverPretrain
  >>> from deepchem.models.torch_models.grover_layers import GroverEmbedding, GroverAtomVocabPredictor, GroverBondVocabPredictor, GroverFunctionalGroupPredictor
  >>> smiles = ['CC', 'CCC', 'CC(=O)C']
  
  >>> fg = dc.feat.CircularFingerprint()
  >>> featurizer = dc.feat.GroverFeaturizer(features_generator=fg)
  
  >>> graphs = featurizer.featurize(smiles)
  >>> batched_graph = BatchGroverGraph(graphs)
  >>> grover_graph_attributes = batched_graph.get_components()
  >>> f_atoms, f_bonds, a2b, b2a, b2revb, a2a, a_scope, b_scope, _ = grover_graph_attributes
  >>> components = {}
  >>> components['embedding'] = GroverEmbedding(node_fdim=f_atoms.shape[1], edge_fdim=f_bonds.shape[1])
  >>> components['atom_vocab_task_atom'] = GroverAtomVocabPredictor(vocab_size=10, in_features=128)
  >>> components['atom_vocab_task_bond'] = GroverAtomVocabPredictor(vocab_size=10, in_features=128)
  >>> components['bond_vocab_task_atom'] = GroverBondVocabPredictor(vocab_size=10, in_features=128)
  >>> components['bond_vocab_task_bond'] = GroverBondVocabPredictor(vocab_size=10, in_features=128)
  >>> components['functional_group_predictor'] = GroverFunctionalGroupPredictor(10)
  >>> model = GroverPretrain(**components)
  
  >>> inputs = f_atoms, f_bonds, a2b, b2a, b2revb, a_scope, b_scope, a2a
  >>> output = model(inputs)
  
  Reference
  ---------
  .. Rong, Yu, et al. "Self-supervised graph transformer on large-scale molecular data." Advances in Neural Information Processing Systems 33 (2020): 12559-12571.
code: def __init__(
      self,
      embedding: nn.Module,
      atom_vocab_task_atom: nn.Module,
      atom_vocab_task_bond: nn.Module,
      bond_vocab_task_atom: nn.Module,
      bond_vocab_task_bond: nn.Module,
      functional_group_predictor: nn.Module,
  ):
      super(GroverPretrain, self).__init__()
      self.embedding = embedding
      self.atom_vocab_task_atom = atom_vocab_task_atom
      self.atom_vocab_task_bond = atom_vocab_task_bond
      self.bond_vocab_task_atom = bond_vocab_task_atom
      self.bond_vocab_task_bond = bond_vocab_task_bond
      self.functional_group_predictor = functional_group_predictor
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  import numpy
  from typing import List, Sequence, Optional, Any, Tuple
  from rdkit import Chem
  from deepchem.models.torch_models.modular import ModularTorchModel
  from deepchem.models.torch_models.grover_layers import GroverEmbedding, GroverBondVocabPredictor, GroverAtomVocabPredictor, GroverFunctionalGroupPredictor
  from deepchem.models.torch_models.readout import GroverReadout
  from deepchem.feat.vocabulary_builders import GroverAtomVocabularyBuilder, GroverBondVocabularyBuilder
  from deepchem.utils.grover import BatchGroverGraph
  import logging
label_desc: Use image node_id 1 to create a new GroverPretrain object from inherited base classes: nn with example: obj = GroverPretrain(embedding, atom_vocab_task_atom, atom_vocab_task_bond, bond_vocab_task_atom, bond_vocab_task_bond, functional_group_predictor)