docstr: Args:
      layers: number of layers in the block.
      num_features: number of internal features used.
      in_channels: number of the input channel.
      out_channels: number of the output channel.
      dropout_prob: dropout rate after each dense layer.
      act: activation type and arguments. Defaults to relu.
      norm: feature normalization type and arguments. Defaults to batch norm.
      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",":","layers",":","number","of","layers","in","the","block",".","num_features",":","number","of","internal","features","used",".","in_channels",":","number","of","the","input","channel",".","out_channels",":","number","of","the","output","channel",".","dropout_prob",":","dropout","rate","after","each","dense","layer",".","act",":","activation","type","and","arguments",".","Defaults","to","relu",".","norm",":","feature","normalization","type","and","arguments",".","Defaults","to","batch","norm",".","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,
      layers: int,
      num_features: int,
      in_channels: int,
      out_channels: int,
      dropout_prob: float = 0.0,
      act: str | tuple = ("relu", {"inplace": True}),
      norm: str | tuple = "batch",
      kernel_size: int = 3,
      same_padding: bool = False,
  ) -> None:
      """
      Args:
          layers: number of layers in the block.
          num_features: number of internal features used.
          in_channels: number of the input channel.
          out_channels: number of the output channel.
          dropout_prob: dropout rate after each dense layer.
          act: activation type and arguments. Defaults to relu.
          norm: feature normalization type and arguments. Defaults to batch norm.
          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]
  
      padding: int = kernel_size // 2 if same_padding else 0
  
      self.add_module(
          "conva",
          conv_type(
              in_channels,
              in_channels // 4,
              kernel_size=kernel_size,
              padding=padding,
              bias=False,
          ),
      )
  
      _in_channels = in_channels // 4
      for i in range(layers):
          layer = _DenseLayerDecoder(
              num_features,
              _in_channels,
              out_channels,
              dropout_prob,
              act=act,
              norm=norm,
              kernel_size=kernel_size,
              padding=padding,
          )
          _in_channels += out_channels
          self.add_module("denselayerdecoder%d" % (i + 1), layer)
  
      trans = _Transition(_in_channels, act=act, norm=norm)
      self.add_module("bna_block", trans)
      self.add_module(
          "convf",
          conv_type(
              _in_channels, _in_channels, kernel_size=1, 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 _DecoderBlock object from inherited base classes: nn with example: obj = _DecoderBlock(layers, num_features, in_channels, out_channels, dropout_prob, act, norm, kernel_size, same_padding)