class_docstr: Definition of the DXtrem network from :cite:`xsoria2020dexined`.
  
  Return:
      A list of tensor with the intermediate features which the last element
      is the edges map with shape :math:`(B,1,H,W)`.
  
  Example:
      >>> img = torch.rand(1, 3, 320, 320)
      >>> net = DexiNed(pretrained=False)
      >>> out = net(img)
      >>> out[-1].shape
      torch.Size([1, 1, 320, 320])
class_docstr_tok: ["Definition","of","the","DXtrem","network","from",":","cite",":","`","xsoria2020dexined","`",".","Return",":","A","list","of","tensor","with","the","intermediate","features","which","the","last","element","is","the","edges","map","with","shape",":","math",":","`","(","B,1",",","H",",","W",")","`",".","Example",":",">",">",">","img","=","torch.rand","(","1",",","3",",","320",",","320",")",">",">",">","net","=","DexiNed","(","pretrained=False",")",">",">",">","out","=","net","(","img",")",">",">",">","out","[","-1","]",".shape","torch.Size","(","[","1",",","1",",","320",",","320","]",")"]
code: def __init__(self, pretrained: bool) -> None:
      super().__init__()
      self.block_1 = DoubleConvBlock(3, 32, 64, stride=2)
      self.block_2 = DoubleConvBlock(64, 128, use_act=False)
      self.dblock_3 = _DenseBlock(2, 128, 256)  # [128,256,100,100]
      self.dblock_4 = _DenseBlock(3, 256, 512)
      self.dblock_5 = _DenseBlock(3, 512, 512)
      self.dblock_6 = _DenseBlock(3, 512, 256)
      self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
  
      # left skip connections, figure in Journal
      self.side_1 = SingleConvBlock(64, 128, 2)
      self.side_2 = SingleConvBlock(128, 256, 2)
      self.side_3 = SingleConvBlock(256, 512, 2)
      self.side_4 = SingleConvBlock(512, 512, 1)
      self.side_5 = SingleConvBlock(512, 256, 1)
  
      # right skip connections, figure in Journal paper
      self.pre_dense_2 = SingleConvBlock(128, 256, 2)
      self.pre_dense_3 = SingleConvBlock(128, 256, 1)
      self.pre_dense_4 = SingleConvBlock(256, 512, 1)
      self.pre_dense_5 = SingleConvBlock(512, 512, 1)
      self.pre_dense_6 = SingleConvBlock(512, 256, 1)
  
      # USNet
      self.up_block_1 = UpConvBlock(64, 1)
      self.up_block_2 = UpConvBlock(128, 1)
      self.up_block_3 = UpConvBlock(256, 2)
      self.up_block_4 = UpConvBlock(512, 3)
      self.up_block_5 = UpConvBlock(512, 4)
      self.up_block_6 = UpConvBlock(256, 4)
      self.block_cat = SingleConvBlock(
          6, 1, stride=1, use_bs=False
      )  # hed fusion method
      # self.block_cat = CoFusion(6,6)# cats fusion method
  
      if pretrained:
          self.load_from_file(url)
      else:
          self.apply(weight_init)
  
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 DexiNed object from inherited base classes: Module with example: obj = DexiNed(pretrained)