class_docstr: ContextWithImage Module.
  
  Encodes image features and context, and combines by summing or concatenation.
class_docstr_tok: ["ContextWithImage","Module",".","Encodes","image","features","and","context",",","and","combines","by","summing","or","concatenation","."]
code: def _build_image_encoder(self):
      image_layers = [nn.Linear(self.img_dim, self.full_embedding_size)]
      for _ in range(self.n_img_layers - 1):
          image_layers += [
              nn.ReLU(),
              nn.Dropout(p=self.dropout_frac),
              nn.Linear(
                  self.full_embedding_size, self.full_embedding_size
              ),
          ]
      self.image_encoder = nn.Sequential(*image_layers)
  
imports: from enum import Enum
  from functools import reduce
  from typing import List, Tuple, Optional, Union
  import torch
  import torch.nn
  from parlai.agents.transformer.modules import TransformerGeneratorModel, TransformerEncoder
  from parlai.core.dict import DictionaryAgent
  from parlai.core.opt import Opt
label_desc: Use image node_id 2 for calling the ContextWithImageEncoder obj's underlying member method code with example usage: obj._build_image_encoder() without return types