code: def _compare_processed_for_multimodality(
      self, transformer_input, lm_labels_sum=0
  ):
      input_ids = transformer_input["input_ids"]
      self.assertEqual(input_ids["image"].dim(), 3)
      self.assertEqual(list(input_ids["image"].size()), [2, 1, 256])
  
      self.assertEqual(input_ids["body"].dim(), 2)
      self.assertEqual(list(input_ids["body"].size()), [2, 128])
  
      self.assertEqual(input_ids["ocr"].dim(), 2)
      self.assertEqual(list(input_ids["ocr"].size()), [2, 128])
  
      # Test specific modality keys case
      # Test encoder with resnet
      # Test input_mask case, test modality_mask case
  
      position_ids = transformer_input["position_ids"]
      test_utils.compare_tensors(
          position_ids["image"], torch.tensor([[0], [0]])
      )
      test_utils.compare_tensors(
          position_ids["body"],
          torch.arange(0, 128).unsqueeze(0).expand((2, 128)),
      )
      test_utils.compare_tensors(
          position_ids["ocr"],
          torch.arange(0, 128).unsqueeze(0).expand((2, 128)),
      )
  
      masks = transformer_input["masks"]
      test_utils.compare_tensors(
          masks["image"], torch.tensor([[1], [1]])
      )
      test_utils.compare_tensors(
          masks["body"], torch.ones((2, 128)).long()
      )
      test_utils.compare_tensors(
          masks["ocr"], torch.ones((2, 128)).long()
      )
  
      segment_ids = transformer_input["segment_ids"]
      test_utils.compare_tensors(
          segment_ids["image"], torch.tensor([[0], [0]])
      )
      test_utils.compare_tensors(
          segment_ids["body"], torch.ones((2, 128)).long()
      )
      test_utils.compare_tensors(
          segment_ids["ocr"],
          torch.full((2, 128), dtype=torch.long, fill_value=2).long(),
      )
  
      mlm_labels = transformer_input["mlm_labels"]
      self.assertEqual(
          list(mlm_labels["combined_labels"].size()), [2, 257]
      )
      # -2 is for image negative labels
      self.assertEqual(
          mlm_labels["combined_labels"].sum().item(), lm_labels_sum - 2
      )
  
imports: import gc
  import unittest
  import tests.test_utils
  import torch
  from mmf.common.sample import SampleList
  from mmf.models.mmf_transformer import MMFTransformer, MMFTransformerModalityConfig
  from mmf.models.transformers.heads.mlm import MLM
  from mmf.modules.encoders import EncoderFactory, IdentityEncoder, ImageEncoderFactory, ImageEncoderTypes, ResNet152ImageEncoder, TextEncoderFactory, TextEncoderTypes
  from mmf.utils.build import build_model
  from mmf.utils.configuration import Configuration
  from mmf.utils.env import setup_imports, teardown_imports
  from omegaconf import OmegaConf
  from tests.test_utils import skip_if_no_pytorchvideo
label_desc: Use image node_id 6 for calling the TestMMFTransformer obj's underlying member method code with example usage: obj._compare_processed_for_multimodality(transformer_input, lm_labels_sum) without return types