code: def get_all_params_for_weight_decay_optimization(
      model: Union[torch.nn.Module, List[torch.nn.Module]],
  ) -> Tuple[Dict[str, List[torch.nn.Parameter]]]:
      """Use all params for weight decay."""
      modules = listify_model(model)
  
      weight_decay_params = [
          p
          for module in modules
          for module_ in module.modules()
          for p in module_._parameters.values()
          if p is not None
      ]
  
      return ({"params": weight_decay_params},)
  
imports: import itertools
  import math
  from typing import Dict, Iterator, List, Tuple, Union
  import torch
  import torch.nn
  from torch import Tensor
label_desc: Use image node_id 24 for calling a global function with example usage: get_all_params_for_weight_decay_optimization(model) and returns: dict