class_docstr: Wide_resnet version of DeepLabV3
  mod1
  pool2
  mod2 str2
  pool3
  mod3-7
  
    structure: [3, 3, 6, 3, 1, 1]
    channels = [(128, 128), (256, 256), (512, 512), (512, 1024), (512, 1024, 2048),
                (1024, 2048, 4096)]
code: def forward(self, inp):
      x_size = inp.size()
  
      # res 1
      m1 = self.mod1(inp)
  
      # res 2
      m2 = self.mod2(self.pool2(m1))
  
      # res 3
      m3 = self.mod3(self.pool3(m2))
  
      # res 4-7
      m4 = self.mod4(m3)
      m5 = self.mod5(m4)
      m6 = self.mod6(m5)
      m7 = self.mod7(m6)
  
      s3 = F.interpolate(
          self.dsn3(m3), x_size[2:], mode="bilinear", align_corners=True
      )
      s4 = F.interpolate(
          self.dsn4(m4), x_size[2:], mode="bilinear", align_corners=True
      )
      s7 = F.interpolate(
          self.dsn7(m7), x_size[2:], mode="bilinear", align_corners=True
      )
  
      m1f = F.interpolate(
          m1, x_size[2:], mode="bilinear", align_corners=True
      )
  
      im_arr = (
          inp.cpu().numpy().transpose((0, 2, 3, 1)).astype(np.uint8)
      )
      canny = np.zeros((x_size[0], 1, x_size[2], x_size[3]))
      for i in range(x_size[0]):
          canny[i] = cv2.Canny(im_arr[i], 10, 100)
  
      if self.is_cuda:
          canny = torch.from_numpy(canny).cuda().float()
      else:
          canny = torch.from_numpy(canny).float()
  
      cs = self.res1(m1f)
      cs = F.interpolate(
          cs, x_size[2:], mode="bilinear", align_corners=True
      )
      cs = self.d1(cs)
      cs = self.gate1(cs, s3)
      cs = self.res2(cs)
      cs = F.interpolate(
          cs, x_size[2:], mode="bilinear", align_corners=True
      )
      cs = self.d2(cs)
      cs = self.gate2(cs, s4)
      cs = self.res3(cs)
      cs = F.interpolate(
          cs, x_size[2:], mode="bilinear", align_corners=True
      )
      cs = self.d3(cs)
      cs = self.gate3(cs, s7)
      cs = self.fuse(cs)
      cs = F.interpolate(
          cs, x_size[2:], mode="bilinear", align_corners=True
      )
      edge_out = self.sigmoid(cs)
      cat = torch.cat((edge_out, canny), dim=1)
      acts = self.cw(cat)
      acts = self.sigmoid(acts)
  
      # aspp
      x = self.aspp(m7, acts)
      dec0_up = self.bot_aspp(x)
  
      dec0_fine = self.bot_fine(m2)
      dec0_up = self.interpolate(
          dec0_up, m2.size()[2:], mode="bilinear", align_corners=True
      )
      dec0 = [dec0_fine, dec0_up]
      dec0 = torch.cat(dec0, 1)
  
      dec1 = self.final_seg(dec0)
      seg_out = self.interpolate(dec1, x_size[2:], mode="bilinear")
  
      if self.training and self.aux:
          return [seg_out, edge_out]
      else:
          return seg_out
  
imports: import torch
  import torch.nn.functional
  from torch import nn
  from .None import Resnet
  from .wider_resnet import wider_resnet38_a2
  from .mynn import initialize_weights, Norm2d
  from torch.autograd import Variable
  from .my_functionals import GatedSpatialConv
  import cv2
  import numpy
label_desc: Use image node_id 2 for calling the GSCNN obj's underlying member method code with example usage: obj.forward(inp) and returns: list, seg_out