code: def __init__(
      self,
      *dims: int,
      module: Module,
      norm_type: Optional[str] = "layer",
      norm_kwargs: Optional[Dict[str, Any]] = None,
  ):
      super().__init__()
      if norm_kwargs is None:
          norm_kwargs = {}
      self.norms = ModuleList([])
      for dim in dims:
          self.norms.append(
              NormFactory(norm_type).make(dim, **norm_kwargs)
          )
      self.module = module
  
imports: import torch
  import torch.nn
  from abc import abstractmethod
  from torch import Tensor
  from typing import Any
  from typing import Dict
  from typing import Type
  from typing import Tuple
  from typing import Optional
  from torch.nn import Module
  from torch.nn import ModuleList
  from cftool.misc import WithRegister
  from cftool.array import squeeze
  from .convs import get_conv_blocks
  from .convs import Conv2d
  from .norms import NormFactory
  from .customs import Linear
  from .attentions import Attention
  from ...misc.toolkit import get_device
  from ...misc.toolkit import eval_context
label_desc: Use image node_id 1 to create a new PreNorm object from inherited base classes: Module with example: obj = PreNorm()