code: def __init__(self, field, hidden_dims):
      super().__init__()
  
      input_dims = field.vocab.vectors.shape[1]
      self.emb = nn.Embedding(
          len(field.vocab.itos),
          input_dims,
          padding_idx=field.vocab.stoi[field.pad_token],
      )
      self.emb.weight[:] = field.vocab.vectors
      self.proj = nn.Linear(input_dims, hidden_dims)
      nn.init.xavier_uniform_(self.proj.weight)
      nn.init.constant_(self.proj.bias, 0)
  
      disable_grad(self.emb)
  
imports: import argparse
  import pickle
  import time
  import dgl
  import dgl.function
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.data import DataLoader, IterableDataset
  from ..None import utils
label_desc: Use image node_id 1 to create a new BagOfWordsPretrained object from inherited base classes: nn with example: obj = BagOfWordsPretrained(field, hidden_dims)