docstr: Args:
      decode_config: number of layers for each block.
      act: activation type and arguments. Defaults to relu.
      norm: feature normalization type and arguments. Defaults to batch norm.
      dropout_prob: dropout rate after each dense layer.
      out_channels: number of the output channel.
      kernel_size: size of the kernel for >1 convolutions (dependent on mode)
      same_padding: whether to do padding for >1 convolutions to ensure
          the output size is the same as the input size.
docstr_tok: ["Args",":","decode_config",":","number","of","layers","for","each","block",".","act",":","activation","type","and","arguments",".","Defaults","to","relu",".","norm",":","feature","normalization","type","and","arguments",".","Defaults","to","batch","norm",".","dropout_prob",":","dropout","rate","after","each","dense","layer",".","out_channels",":","number","of","the","output","channel",".","kernel_size",":","size","of","the","kernel","for",">","1","convolutions","(","dependent","on","mode",")","same_padding",":","whether","to","do","padding","for",">","1","convolutions","to","ensure","the","output","size","is","the","same","as","the","input","size","."]
code: def __init__(
      self,
      decode_config: Sequence[int] = (8, 4),
      act: str | tuple = ("relu", {"inplace": True}),
      norm: str | tuple = "batch",
      dropout_prob: float = 0.0,
      out_channels: int = 2,
      kernel_size: int = 3,
      same_padding: bool = False,
  ) -> None:
      """
      Args:
          decode_config: number of layers for each block.
          act: activation type and arguments. Defaults to relu.
          norm: feature normalization type and arguments. Defaults to batch norm.
          dropout_prob: dropout rate after each dense layer.
          out_channels: number of the output channel.
          kernel_size: size of the kernel for >1 convolutions (dependent on mode)
          same_padding: whether to do padding for >1 convolutions to ensure
              the output size is the same as the input size.
      """
      super().__init__()
      conv_type: Callable = Conv[Conv.CONV, 2]
  
      # decode branches
      _in_channels = 1024
      _num_features = 128
      _out_channels = 32
  
      self.decoder_blocks = nn.Sequential()
      for i, num_layers in enumerate(decode_config):
          block = _DecoderBlock(
              layers=num_layers,
              num_features=_num_features,
              in_channels=_in_channels,
              out_channels=_out_channels,
              dropout_prob=dropout_prob,
              act=act,
              norm=norm,
              kernel_size=kernel_size,
              same_padding=same_padding,
          )
          self.decoder_blocks.add_module(f"decoderblock{i + 1}", block)
          _in_channels = 512
  
      # output layers
      self.output_features = nn.Sequential()
      _i = len(decode_config)
      _pad_size = (kernel_size - 1) // 2
      _seq_block = nn.Sequential(
          OrderedDict(
              [
                  (
                      "conva",
                      conv_type(
                          256,
                          64,
                          kernel_size=kernel_size,
                          stride=1,
                          bias=False,
                          padding=_pad_size,
                      ),
                  )
              ]
          )
      )
  
      self.output_features.add_module(
          f"decoderblock{_i + 1}", _seq_block
      )
  
      _seq_block = nn.Sequential(
          OrderedDict(
              [
                  (
                      "bn",
                      get_norm_layer(
                          name=norm, spatial_dims=2, channels=64
                      ),
                  ),
                  ("relu", get_act_layer(name=act)),
                  (
                      "conv",
                      conv_type(
                          64, out_channels, kernel_size=1, stride=1
                      ),
                  ),
              ]
          )
      )
  
      self.output_features.add_module(
          f"decoderblock{_i + 2}", _seq_block
      )
  
      self.upsample = UpSample(
          2,
          scale_factor=2,
          mode=UpsampleMode.NONTRAINABLE,
          interp_mode=InterpolateMode.BILINEAR,
          bias=False,
      )
  
imports: from __future__ import annotations
  import os
  import re
  import warnings
  from collections import OrderedDict
  from collections.abc import Callable, Sequence
  import torch
  import torch.nn
  from monai.apps.utils import download_url
  from monai.networks.blocks import UpSample
  from monai.networks.layers.factories import Conv, Dropout
  from monai.networks.layers.utils import get_act_layer, get_norm_layer
  from monai.utils.enums import HoVerNetBranch, HoVerNetMode, InterpolateMode, UpsampleMode
  from monai.utils.module import export, look_up_option
label_desc: Use image node_id 1 to create a new _DecoderBranch object from inherited base classes: nn with example: obj = _DecoderBranch(decode_config, act, norm, dropout_prob, out_channels, kernel_size, same_padding)