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 forward(self, x: Tensor) -> list[Tensor]:
      # Block 1
      block_1 = self.block_1(x)
      block_1_side = self.side_1(block_1)
  
      # Block 2
      block_2 = self.block_2(block_1)
      block_2_down = self.maxpool(block_2)
      block_2_add = block_2_down + block_1_side
      block_2_side = self.side_2(block_2_add)
  
      # Block 3
      block_3_pre_dense = self.pre_dense_3(block_2_down)
      block_3, _ = self.dblock_3([block_2_add, block_3_pre_dense])
      block_3_down = self.maxpool(block_3)  # [128,256,50,50]
      block_3_add = block_3_down + block_2_side
      block_3_side = self.side_3(block_3_add)
  
      # Block 4
      block_2_resize_half = self.pre_dense_2(block_2_down)
      block_4_pre_dense = self.pre_dense_4(
          block_3_down + block_2_resize_half
      )
      block_4, _ = self.dblock_4([block_3_add, block_4_pre_dense])
      block_4_down = self.maxpool(block_4)
      block_4_add = block_4_down + block_3_side
      block_4_side = self.side_4(block_4_add)
  
      # Block 5
      block_5_pre_dense = self.pre_dense_5(
          block_4_down
      )  # block_5_pre_dense_512 +block_4_down
      block_5, _ = self.dblock_5([block_4_add, block_5_pre_dense])
      block_5_add = block_5 + block_4_side
  
      # Block 6
      block_6_pre_dense = self.pre_dense_6(block_5)
      block_6, _ = self.dblock_6([block_5_add, block_6_pre_dense])
  
      # upsampling blocks
      out_shape = x.shape[-2:]
      out_1 = self.up_block_1(block_1, out_shape)
      out_2 = self.up_block_2(block_2, out_shape)
      out_3 = self.up_block_3(block_3, out_shape)
      out_4 = self.up_block_4(block_4, out_shape)
      out_5 = self.up_block_5(block_5, out_shape)
      out_6 = self.up_block_6(block_6, out_shape)
      results = [out_1, out_2, out_3, out_4, out_5, out_6]
  
      # concatenate multiscale outputs
      block_cat = concatenate(results, 1)  # Bx6xHxW
      block_cat = self.block_cat(block_cat)  # Bx1xHxW
  
      # return results
      results.append(block_cat)
      return results
  
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 3 for calling the DexiNed obj's underlying member method code with example usage: obj.forward(x) and returns: results