code: def __init__(
      self,
      dcunet_architecture: str = "DilDCUNet-v2",
      dcunet_time_embedding: str = "gfp",
      dcunet_temb_layers_global: int = 2,
      dcunet_temb_layers_local: int = 1,
      dcunet_temb_activation: str = "silu",
      dcunet_time_embedding_complex: bool = False,
      dcunet_fix_length: str = "pad",
      dcunet_mask_bound: str = "none",
      dcunet_norm_type: str = "bN",
      dcunet_activation: str = "relu",
      embed_dim: int = 128,
      **kwargs,
  ):
      super().__init__()
  
      self.architecture = dcunet_architecture
      self.fix_length_mode = (
          dcunet_fix_length if dcunet_fix_length != "none" else None
      )
      self.norm_type = dcunet_norm_type
      self.activation = dcunet_activation
      self.input_channels = 2
      # for x_t and y -- note that this is 2 rather than 4,
      # because we directly treat complex channels in this DNN
      self.time_embedding = (
          dcunet_time_embedding
          if dcunet_time_embedding != "none"
          else None
      )
      self.time_embedding_complex = dcunet_time_embedding_complex
      self.temb_layers_global = dcunet_temb_layers_global
      self.temb_layers_local = dcunet_temb_layers_local
      self.temb_activation = dcunet_temb_activation
      conf_encoders, conf_decoders = DCUNET_ARCHITECTURES[
          dcunet_architecture
      ]
  
      # Replace `input_channels` in encoders config
      _replaced_input_channels, *rest = conf_encoders[0]
      encoders = ((self.input_channels, *rest), *conf_encoders[1:])
      decoders = conf_decoders
      self.encoders_stride_product = np.prod(
          [enc_stride for _, _, _, enc_stride, _, _ in encoders], axis=0
      )
  
      # Prepare kwargs for encoder and decoder
      # (to potentially be modified before layer instantiation)
      encoder_decoder_kwargs = dict(
          norm_type=self.norm_type,
          activation=self.activation,
          temb_layers=self.temb_layers_local,
          temb_activation=self.temb_activation,
      )
  
      # Instantiate (global) time embedding layer
      embed_ops = []
      if self.time_embedding is not None:
          complex_valued = self.time_embedding_complex
          if self.time_embedding == "gfp":
              embed_ops += [
                  GaussianFourierProjection(
                      embed_dim=embed_dim, complex_valued=complex_valued
                  )
              ]
              encoder_decoder_kwargs["embed_dim"] = embed_dim
          elif self.time_embedding == "ds":
              embed_ops += [
                  DiffusionStepEmbedding(
                      embed_dim=embed_dim, complex_valued=complex_valued
                  )
              ]
              encoder_decoder_kwargs["embed_dim"] = embed_dim
  
          if self.time_embedding_complex:
              assert self.time_embedding in (
                  "gfp",
                  "ds",
              ), "Complex timestep embedding only available for gfp and ds"
              encoder_decoder_kwargs["complex_time_embedding"] = True
          for _ in range(self.temb_layers_global):
              embed_ops += [
                  ComplexLinear(
                      embed_dim, embed_dim, complex_valued=True
                  ),
                  OnReIm(get_activation(dcunet_temb_activation)),
              ]
      self.embed = nn.Sequential(*embed_ops)
  
      # Instantiate DCUNet layers #
      output_layer = ComplexConvTranspose2d(*decoders[-1])
      encoders = [
          DCUNetComplexEncoderBlock(*args, **encoder_decoder_kwargs)
          for args in encoders
      ]
      decoders = [
          DCUNetComplexDecoderBlock(*args, **encoder_decoder_kwargs)
          for args in decoders[:-1]
      ]
  
      self.mask_bound = (
          dcunet_mask_bound if dcunet_mask_bound != "none" else None
      )
      if self.mask_bound is not None:
          raise NotImplementedError(
              "sorry, mask bounding not implemented at the moment"
          )
          # TODO we can't use nn.Sequential since the ComplexConvTranspose2d needs a
          # second `output_size` argument
      # operations = (output_layer, complex_nn.BoundComplexMask(self.mask_bound))
      # output_layer = nn.Sequential(*[x for x in operations if x is not None])
  
      assert len(encoders) == len(decoders) + 1
      self.encoders = nn.ModuleList(encoders)
      self.decoders = nn.ModuleList(decoders)
      self.output_layer = output_layer or nn.Identity()
  
imports: import functools
  from functools import partial
  import numpy
  import torch
  from torch import Tensor, nn
  from torch.nn.modules.batchnorm import _BatchNorm
label_desc: Use image node_id 1 to create a new DCUNet object from inherited base classes: nn with example: obj = DCUNet(dcunet_architecture, dcunet_time_embedding, dcunet_temb_layers_global, dcunet_temb_layers_local, dcunet_temb_activation, dcunet_time_embedding_complex, dcunet_fix_length, dcunet_mask_bound, dcunet_norm_type, dcunet_activation, embed_dim)