docstr: Args:
      spatial_dims: number of spatial dimensions of the input image.
      layers: number of layers in the block.
      in_channels: number of the input channel.
      bn_size: multiplicative factor for number of bottle neck layers.
          (i.e. bn_size * k features in the bottleneck layer)
      growth_rate: how many filters to add each layer (k in paper).
      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.
docstr_tok: ["Args",":","spatial_dims",":","number","of","spatial","dimensions","of","the","input","image",".","layers",":","number","of","layers","in","the","block",".","in_channels",":","number","of","the","input","channel",".","bn_size",":","multiplicative","factor","for","number","of","bottle","neck","layers",".","(","i.e",".","bn_size","*","k","features","in","the","bottleneck","layer",")","growth_rate",":","how","many","filters","to","add","each","layer","(","k","in","paper",")",".","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","."]
code: def __init__(
      self,
      spatial_dims: int,
      layers: int,
      in_channels: int,
      bn_size: int,
      growth_rate: int,
      dropout_prob: float,
      act: str | tuple = ("relu", {"inplace": True}),
      norm: str | tuple = "batch",
  ) -> None:
      """
      Args:
          spatial_dims: number of spatial dimensions of the input image.
          layers: number of layers in the block.
          in_channels: number of the input channel.
          bn_size: multiplicative factor for number of bottle neck layers.
              (i.e. bn_size * k features in the bottleneck layer)
          growth_rate: how many filters to add each layer (k in paper).
          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.
      """
      super().__init__()
      for i in range(layers):
          layer = _DenseLayer(
              spatial_dims,
              in_channels,
              growth_rate,
              bn_size,
              dropout_prob,
              act=act,
              norm=norm,
          )
          in_channels += growth_rate
          self.add_module("denselayer%d" % (i + 1), layer)
  
imports: from __future__ import annotations
  import re
  from collections import OrderedDict
  from collections.abc import Callable, Sequence
  import torch
  import torch.nn
  from torch.hub import load_state_dict_from_url
  from monai.networks.layers.factories import Conv, Dropout, Pool
  from monai.networks.layers.utils import get_act_layer, get_norm_layer
  from monai.utils.module import look_up_option
label_desc: Use image node_id 1 to create a new _DenseBlock object from inherited base classes: nn with example: obj = _DenseBlock(spatial_dims, layers, in_channels, bn_size, growth_rate, dropout_prob, act, norm)