code: def _forward_ocr_encoding(self, sample_list, fwd_results):
      # OCR FastText feature (300-dim)
      ocr_fasttext = sample_list.context_feature_0
      ocr_fasttext = F.normalize(ocr_fasttext, dim=-1)
      assert ocr_fasttext.size(-1) == 300
  
      # OCR PHOC feature (604-dim)
      ocr_phoc = sample_list.context_feature_1
      ocr_phoc = F.normalize(ocr_phoc, dim=-1)
      assert ocr_phoc.size(-1) == 604
  
      # OCR appearance feature: Faster R-CNN fc7
      ocr_fc6 = sample_list.image_feature_1[
          :, : ocr_fasttext.size(1), :
      ]
      ocr_fc7 = self.ocr_faster_rcnn_fc7(ocr_fc6)
      ocr_fc7 = F.normalize(ocr_fc7, dim=-1)
  
      # OCR order vectors (legacy from LoRRA model; set to all zeros)
      # TODO remove OCR order vectors; they are not needed
      ocr_order_vectors = torch.zeros_like(sample_list.order_vectors)
  
      if self.remove_ocr_fasttext:
          ocr_fasttext = torch.zeros_like(ocr_fasttext)
      if self.remove_ocr_phoc:
          ocr_phoc = torch.zeros_like(ocr_phoc)
      if self.remove_ocr_frcn:
          ocr_fc7 = torch.zeros_like(ocr_fc7)
      ocr_feat = torch.cat(
          [ocr_fasttext, ocr_phoc, ocr_fc7, ocr_order_vectors], dim=-1
      )
      ocr_bbox = sample_list.ocr_bbox_coordinates
      if self.remove_ocr_semantics:
          ocr_feat = torch.zeros_like(ocr_feat)
      if self.remove_ocr_bbox:
          ocr_bbox = torch.zeros_like(ocr_bbox)
      ocr_mmt_in = self.ocr_feat_layer_norm(
          self.linear_ocr_feat_to_mmt_in(ocr_feat)
      ) + self.ocr_bbox_layer_norm(
          self.linear_ocr_bbox_to_mmt_in(ocr_bbox)
      )
      ocr_mmt_in = self.ocr_drop(ocr_mmt_in)
      fwd_results["ocr_mmt_in"] = ocr_mmt_in
  
      # binary mask of valid OCR vs padding
      ocr_nums = sample_list.context_info_0.max_features
      fwd_results["ocr_mask"] = _get_mask(ocr_nums, ocr_mmt_in.size(1))
  
imports: import functools
  import logging
  import math
  import torch
  import torch.nn.functional
  from mmf.common.registry import registry
  from mmf.models.base_model import BaseModel
  from mmf.modules.layers import ClassifierLayer
  from mmf.utils.build import build_image_encoder
  from omegaconf import OmegaConf
  from torch import nn
label_desc: Use image node_id 13 for calling the M4C obj's underlying member method code with example usage: obj._forward_ocr_encoding(sample_list, fwd_results) without return types