code: def create_norm_layer(
      norm: str, input_rank: int, num_features: int, **norm_params
  ) -> Module:
      if norm == "batch":
          # We use a different batch norm depending on the input_rank.
          # TODO(travis): consider moving this behind a general BatchNorm interface to avoid this kludge.
          if input_rank not in {2, 3}:
              ValueError(
                  f"`input_rank` parameter expected to be either 2 or 3, but found {input_rank}."
              )
          norm = f"{norm}_{input_rank-1}d"
  
      norm_cls = norm_registry.get(norm)
      if norm_cls is None:
          raise ValueError(
              f"Unsupported value for `norm` param: {norm}. Supported values are: {list(norm_registry.keys())}"
          )
  
      return norm_cls(num_features, **norm_params)
  
imports: import logging
  from typing import Optional
  import numpy
  import torch
  from torch.nn import BatchNorm1d, BatchNorm2d, LayerNorm, Module
  from ludwig.utils.torch_utils import LudwigModule
label_desc: Use image node_id 1 for calling a global function with example usage: create_norm_layer(norm, input_rank, num_features) and returns: norm_cls