code: def __init__(
      self,
      in_features: int,
      mid_features: int,
      out_features: Optional[int] = None,
      stride: int = 1,
      use_act: bool = True,
  ) -> None:
      super().__init__()
      if out_features is None:
          out_features = mid_features
      self.add_module(
          "conv1",
          nn.Conv2d(
              in_features, mid_features, 3, padding=1, stride=stride
          ),
      )
      self.add_module("bn1", nn.BatchNorm2d(mid_features))
      self.add_module("relu1", nn.ReLU(inplace=True))
      self.add_module(
          "conv2", nn.Conv2d(mid_features, out_features, 3, padding=1)
      )
      self.add_module("bn2", nn.BatchNorm2d(out_features))
      if use_act:
          self.add_module("relu2", nn.ReLU(inplace=True))
  
imports: from __future__ import annotations
  from collections import OrderedDict
  from typing import Optional
  import torch
  import torch.nn.functional
  from torch import nn
  from kornia.core import Module, Tensor, concatenate
  from kornia.core.check import KORNIA_CHECK
  from kornia.utils import map_location_to_cpu
label_desc: Use image node_id 1 to create a new DoubleConvBlock object from inherited base classes: nn with example: obj = DoubleConvBlock(in_features, mid_features, out_features, stride, use_act)