code: def unset_requires_grad_for_fixed_params(
      config: model.ModelConfig,
      params: Dict[str, torch.nn.parameter.Parameter],
      fixed_param_names: List[str],
      fixed_param_strategy: Optional[str] = None,
  ):
      utils.check_condition(
          not config.lhuc or fixed_param_strategy is None,
          "LHUC fixes all other parameters and is thus not compatible with other fixing strategies.",
      )
      if config.lhuc:
          # fix everything except LHUC-related parameters
          fixed_param_names += [
              name
              for name in params
              if not name.endswith("lhuc.weight")
          ]
          logger.info("LHUC enabled, fixing all non-LHUC parameters")
      elif fixed_param_strategy is not None:
          fixed_param_names += fixed_param_names_from_strategy(
              config, params, fixed_param_strategy
          )
          logger.info(
              "Fixed param strategy: '%s'", fixed_param_strategy
          )
  
      for name in fixed_param_names:
          if name not in params:
              logger.warning(
                  "Fixed parameter name '%s' not part of model parameters, ignoring",
                  name,
              )
              continue
          params[name].requires_grad = False
  
imports: from .None import initial_setup
  import argparse
  import gc
  import logging
  import os
  import shutil
  import sys
  import tempfile
  from typing import Any, cast, Callable, Optional, Dict, List, Tuple, Type
  import torch
  import torch.distributed
  import torch.distributed.elastic.multiprocessing.errors
  from .None import arguments
  from .None import checkpoint_decoder
  from .None import constants
  from .None import convert_deepspeed
  from .None import data_io
  from .None import encoder
  from .None import layers
  from .None import loss
  from .None import lr_scheduler
  from .None import model
  from .None import optimizers
  from .None import training
  from .None import transformer
  from .None import utils
  from .None import vocab
  from .config import Config
  from .log import setup_main_logger
  from .utils import check_condition
label_desc: Use image node_id 16 for calling a global function with example usage: unset_requires_grad_for_fixed_params(config, params, fixed_param_names, fixed_param_strategy) without return types