code: def __init__(self, transformer):
      super().__init__()
      # The transformer takes care of most of the work, but other modules
      # expect us to have an embeddings available
      self.embeddings = transformer.embeddings
      self.embed_dim = transformer.embeddings.embedding_dim
      self.transformer = transformer
  
file_path: ParlAI/projects/wizard_of_wikipedia/generator/modules.py
imports: from typing import Dict
  import numpy
  import torch
  import torch.nn
  from parlai.utils.torch import neginf
  from parlai.agents.transformer.modules import TransformerGeneratorModel
label_desc: Use image node_id 1 to create a new ContextKnowledgeEncoder object from inherited base classes: nn with example: obj = ContextKnowledgeEncoder(transformer)