code: def build(self):
      self._is_direct_features_input = self.config.direct_features_input
      # Encoders
      self.text_encoder = build_text_encoder(self.config.text_encoder)
      self.image_encoder = build_image_encoder(
          self.config.image_encoder, self._is_direct_features_input
      )
  
      # Projectors
      image_proj_config = deepcopy(self.config.image_projection)
      self.image_proj = build_classifier_layer(image_proj_config)
  
      text_proj_config = deepcopy(self.config.text_projection)
      self.text_proj = build_classifier_layer(text_proj_config)
  
      # Aggregators
      self.image_pool = AttnPool1d(self.config.final_hidden_size, 1)
      self.text_pool = AttnPool1d(self.config.final_hidden_size, 1)
  
      # Shared transformer
      transformer_layer = torch.nn.TransformerEncoderLayer(
          self.config.final_hidden_size,
          4,
          2048,
          dropout=0.1,
          activation="relu",
      )
      self.shared_transformer = torch.nn.TransformerEncoder(
          transformer_layer, num_layers=2
      )
  
      # Position embeddings - Image
      self.image_pos_emb = PositionEmbeddingSine(
          self.config.final_hidden_size // 2
      )
  
imports: import math
  from copy import deepcopy
  from dataclasses import dataclass
  from typing import Any, Tuple
  import torch
  from mmf.common.registry import registry
  from mmf.models.base_model import BaseModel
  from mmf.modules.encoders import IdentityEncoder
  from mmf.modules.layers import AttnPool1d
  from mmf.utils.build import build_classifier_layer, build_image_encoder, build_text_encoder
  from mmf.utils.general import filter_grads
  from mmf.utils.modeling import get_bert_configured_parameters
  from mmf.utils.transform import transform_to_batch_sequence
  from omegaconf import MISSING
label_desc: Use image node_id 3 for calling the CMSharedTransformer obj's underlying member method code with example usage: obj.build() without return types