code: def test_image_input_feature(
      image_config: Dict,
      encoder: str,
      height: int,
      width: int,
      num_channels: int,
  ) -> None:
      # setup image input feature definition
      image_def = deepcopy(image_config)
      image_def[ENCODER][TYPE] = encoder
      image_def[ENCODER]["height"] = height
      image_def[ENCODER]["width"] = width
      image_def[ENCODER]["num_channels"] = num_channels
  
      # pickup any other missing parameters
      defaults = ImageInputFeatureConfig(name="foo").to_dict()
      set_def = merge_dict(defaults, image_def)
  
      # ensure no exceptions raised during build
      image_config, _ = load_config_with_kwargs(
          ImageInputFeatureConfig, set_def
      )
      input_feature_obj = ImageInputFeature(image_config).to(DEVICE)
  
      # check one forward pass through input feature
      input_tensor = torch.rand(
          size=(BATCH_SIZE, num_channels, height, width),
          dtype=torch.float32,
      ).to(DEVICE)
  
      encoder_output = input_feature_obj(input_tensor)
      assert encoder_output[ENCODER_OUTPUT].shape == (
          BATCH_SIZE,
          *input_feature_obj.output_shape,
      )
  
file_path: ludwig/tests/ludwig/features/test_image_feature.py
imports: from copy import deepcopy
  from typing import Dict
  import pytest
  import torch
  from ludwig.constants import BFILL, CROP_OR_PAD, ENCODER, ENCODER_OUTPUT, INTERPOLATE, TYPE
  from ludwig.features.image_feature import _ImagePreprocessing, ImageInputFeature
  from ludwig.schema.features.image_feature import ImageInputFeatureConfig
  from ludwig.schema.utils import load_config_with_kwargs
  from ludwig.utils.misc_utils import merge_dict
  from ludwig.utils.torch_utils import get_torch_device
label_desc: Use image node_id 2 for calling a global function with example usage: test_image_input_feature(image_config, encoder, height, width, num_channels) without return types