docstr: If the encoder is not in trainable mode, override the image width and height to be compatible with the
  pretrained encoder image dimension requirements.
docstr_tok: ["If","the","encoder","is","not","in","trainable","mode",",","override","the","image","width","and","height","to","be","compatible","with","the","pretrained","encoder","image","dimension","requirements","."]
code: def set_fixed_preprocessing_params(
      self, model_type: str, preprocessing: "ImagePreprocessingConfig"
  ):
      """If the encoder is not in trainable mode, override the image width and height to be compatible with the
      pretrained encoder image dimension requirements."""
      if (
          self.requires_equal_dimensions()
          and self.required_width() != self.required_height()
      ):
          raise ValueError(
              "Invalid definition. `required_width` and `required_height` are not equal"
          )
  
      preprocessing.requires_equal_dimensions = (
          self.requires_equal_dimensions()
      )
      if not self.trainable or self.use_pretrained:
          preprocessing.height = self.required_height()
          preprocessing.width = self.required_width()
  
imports: from typing import Any, Dict, List, Optional, Tuple, TYPE_CHECKING, Union
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import IMAGE
  from ludwig.schema import utils
  from ludwig.schema.encoders.base import BaseEncoderConfig
  from ludwig.schema.encoders.utils import register_encoder_config
  from ludwig.schema.metadata import ENCODER_METADATA
  from ludwig.schema.utils import ludwig_dataclass
  from ludwig.utils.torch_utils import initializer_registry
label_desc: Use image node_id 2 for calling the ViTConfig obj's underlying member method code with example usage: obj.set_fixed_preprocessing_params(model_type, preprocessing) without return types