class_docstr: Single layer of a DenseNet.
code: def __init__(
      self,
      in_planes,
      growth_rate=32,
      expansion=4,
      use_se=False,
      se_reduction_ratio=16,
  ):
      # assertions:
      assert is_pos_int(in_planes)
      assert is_pos_int(growth_rate)
      assert is_pos_int(expansion)
  
      # add all layers to layer
      super(_DenseLayer, self).__init__()
      intermediate = expansion * growth_rate
      self.add_module("norm-1", nn.BatchNorm2d(in_planes))
      self.add_module("relu-1", nn.ReLU(inplace=INPLACE))
      self.add_module(
          "conv-1",
          nn.Conv2d(
              in_planes,
              intermediate,
              kernel_size=1,
              stride=1,
              bias=False,
          ),
      )
      self.add_module("norm-2", nn.BatchNorm2d(intermediate))
      self.add_module("relu-2", nn.ReLU(inplace=INPLACE))
      self.add_module(
          "conv-2",
          nn.Conv2d(
              intermediate,
              growth_rate,
              kernel_size=3,
              stride=1,
              padding=1,
              bias=False,
          ),
      )
      if use_se:
          self.add_module(
              "se",
              SqueezeAndExcitationLayer(
                  growth_rate, reduction_ratio=se_reduction_ratio
              ),
          )
  
imports: import math
  from collections import OrderedDict
  from typing import Any, Dict, Sequence
  import torch
  import torch.nn
  from classy_vision.generic.util import is_pos_int
  from .None import register_model
  from .classy_model import ClassyModel
  from .squeeze_and_excitation_layer import SqueezeAndExcitationLayer
label_desc: Use image node_id 1 to create a new _DenseLayer object from inherited base classes: nn with example: obj = _DenseLayer(in_planes, growth_rate, expansion, use_se, se_reduction_ratio)