class_docstr: Unit Tests for the ImageLoader.
docstr: Test for given partial image mode.
docstr_tok: ["Test","for","given","partial","image","mode","."]
code: def _base_test_loader(
      self, image_mode_partial: str, no_cuda: bool = False
  ):
      """
      Test for given partial image mode.
      """
      opt = ParlaiParser().parse_args([])
      opt.update(BASE_IMAGE_ARGS)
      opt["no_cuda"] = no_cuda
      for image_mode, dim in IMAGE_MODE_TO_DIM.items():
          if image_mode_partial not in image_mode:
              continue
          opt["image_mode"] = image_mode
          teacher = create_task_agent_from_taskname(opt)[0]
          teacher_act = teacher.get(0)
          self.assertEquals(
              teacher_act["image"].size(),
              dim,
              f"dim mismatch for image mode {image_mode}",
          )
      torch.cuda.empty_cache()
  
file_path: ParlAI/tests/test_image_featurizers.py
imports: import os
  from PIL import Image
  import unittest
  import torch
  import zipfile
  from parlai.core.image_featurizers import ImageLoader
  from parlai.core.params import ParlaiParser
  from parlai.core.teachers import create_task_agent_from_taskname
  from parlai.utils.io import PathManager
  import parlai.utils.testing
label_desc: Use image node_id 1 for calling the TestImageLoader obj's underlying member method code with example usage: obj._base_test_loader(image_mode_partial, no_cuda) without return types