text: # *- coding: utf-8 -*
  
  ###########################################################################
  # https://github.com/Soulempty/BiseNetv2-pytorch
  import torch
  import torch.nn as nn
  from torch.nn import functional as F
  from torchsummary import summary
  from utils.activations import NON_LINEARITY
  from fvcore.nn.flop_count import flop_count  # https://github.com/facebookresearch/fvcore
  from tools.flops_counter.ptflops import get_model_complexity_info
  from thop import profile  # https://github.com/Lyken17/pytorch-OpCounter
  
  __all__ = ['BiSeNetV2AI2']
  
  class conv2d(nn.Module):
      def __init__(self, in_dim, out_dim, k, pad, stride, groups=1, bias=False, use_bn=True, use_rl=True):
          super(conv2d, self).__init__()
          self.use_bn = use_bn
          self.use_rl = use_rl
          self.conv = nn.Conv2d(in_dim, out_dim, k, padding=pad, stride=stride, groups=groups, bias=bias)
          self.bn = nn.BatchNorm2d(out_dim)
          self.relu = nn.ReLU(inplace=True)
  
      def forward(self, bottom):
          if self.use_bn and self.use_rl:
              return self.relu(self.bn(self.conv(bottom)))
          elif self.use_bn:
              return self.bn(self.conv(bottom))
          else:
              return self.conv(bottom)
  
  
  class StemBlock(nn.Module):
      def __init__(self):
          super(StemBlock, self).__init__()
          self.conv1 = conv2d(3, 16, 3, 1, 2)
          self.conv_1x1 = conv2d(16, 8, 1, 0, 1)
          self.conv_3x3 = conv2d(8, 16, 3, 1, 2)
          self.mpooling = nn.MaxPool2d(3, 2, 1)
          self.conv2 = conv2d(32, 16, 3, 1, 1)
  
      def forward(self, bottom):
          base = self.conv1(bottom)
          conv_1 = self.conv_1x1(base)
          conv_3 = self.conv_3x3(conv_1)
          pool = self.mpooling(base)
          cat = torch.cat([conv_3, pool], 1)
          res = self.conv2(cat)
          return res
  
  
  class ContextEmbeddingBlock(nn.Module):
      def __init__(self, in_dim):
          super(ContextEmbeddingBlock, self).__init__()
          self.gap = nn.AdaptiveAvgPool2d(1)  # 1
          self.bn1 = nn.BatchNorm2d(in_dim)
          self.conv1 = conv2d(in_dim, in_dim, 1, 0, 1)
          self.conv2 = conv2d(in_dim, in_dim, 3, 1, 1, use_bn=False, use_rl=False)
  
      def forward(self, bottom):
          gap = self.gap(bottom)
          bn = self.bn1(gap)
          conv1 = self.conv1(bn)
          feat = bottom + conv1
          res = self.conv2(feat)
          return res
  
  
  class GatherExpansion(nn.Module):
      def __init__(self, in_dim, out_dim, stride=1, exp=6):
          super(GatherExpansion, self).__init__()
          exp_dim = in_dim * exp
          self.stride = stride
          self.conv1 = conv2d(in_dim, exp_dim, 3, 1, 1)
          self.dwconv2 = conv2d(exp_dim, exp_dim, 3, 1, 1, exp_dim, use_rl=False)
          self.conv_11 = conv2d(exp_dim, out_dim, 1, 0, 1, use_rl=False)
  
          self.dwconv1 = conv2d(exp_dim, exp_dim, 3, 1, 2, exp_dim, use_rl=False)
          self.dwconv3 = conv2d(in_dim, in_dim, 3, 1, 2, in_dim, use_rl=False)
          self.conv_12 = conv2d(in_dim, out_dim, 1, 0, 1, use_rl=False)
          self.relu = nn.ReLU(inplace=True)
  
      def forward(self, bottom):
          base = self.conv1(bottom)
          if self.stride == 2:
              base = self.dwconv1(base)
              bottom = self.dwconv3(bottom)
              bottom = self.conv_12(bottom)
          x = self.dwconv2(base)
          x = self.conv_11(x)
          res = self.relu(x + bottom)
          return res
  
  class GGMA(nn.Module):
      def __init__(self, shape1, shape2, in_dim, map_dim, matmul_norm=True):
          super(GGMA, self).__init__()
          self.in_dim = in_dim
          self.map_dim = map_dim
          self.matmul_norm = matmul_norm
          self.query_project = conv2d(in_dim+2, map_dim, 1, 0, 1)
          self.key_project = conv2d(in_dim+2, map_dim, 1, 0, 1)
          self.value_project = conv2d(in_dim, map_dim, 1, 0, 1)
          self.out_project = conv2d(map_dim, in_dim, 1, 0, 1)
  
      def forward(self, query_feats, key_feats):
          """Forward function."""
          batch_size,_,qh,qw = query_feats.size()
          _, _, kh, kw = key_feats.size()
  
          qx = torch.arange(-1 * ((qw - 1) / 2), ((qw - 1) / 2) + 1)
          qy = torch.arange(((qh - 1) / 2), -1 * ((qh - 1) / 2) - 1, -1)
          qys, qxs = torch.meshgrid(qy, qx)
          qxys = torch.stack([qxs, qys]).unsqueeze(0)#(1,2,h,w)
  
          qxys = nn.LayerNorm([qh, qw], 0, False)(qxys)
          if torch.cuda.is_available():
              qxys = qxys.cuda()
          qxys = qxys.repeat(batch_size, 1, 1, 1)
  
          # qxys_1 = qxys.reshape(2, -1)  # 对（C,H,W）计算均值方差
          # qmean = qxys_1.mean(dim=1).reshape(2, 1, 1)
          # qstd = qxys_1.std(dim=1, unbiased=False).reshape(2, 1, 1)
          # qxys_ln = (qxys - qmean) / qstd
          # qxys22 = nn.LayerNorm([qh,qw],0,False)(qxys)
          # print(qxys_ln.shape,qxys22)
  
          kx = torch.arange(-1 * ((kw - 1) / 2), ((kw - 1) / 2) + 1)
          ky = torch.arange(((kh - 1) / 2), -1 * ((kh - 1) / 2) - 1, -1)
          kys, kxs = torch.meshgrid(ky, kx)
          kxys = torch.stack([kxs, kys]).unsqueeze(0)#(1,2,h,w)
          # kxys = kxys * (qh/kh)   #adjust
          kxys = nn.LayerNorm([kh, kw], 0, False)(kxys)
          if torch.cuda.is_available():
              kxys = kxys.cuda()
          kxys = kxys.repeat(batch_size, 1, 1, 1)
  
          query = self.query_project(torch.cat((query_feats, qxys), 1))
          # if self.query_downsample is not None:
          #     query = self.query_downsample(query)
          query = query.reshape(*query.shape[:2], -1) #B,C,H*W
          query = query.permute(0, 2, 1).contiguous() #B,H*w,C
  
          key = self.key_project(torch.cat((key_feats, kxys), 1))
          value = self.value_project(key_feats)
          # if self.key_downsample is not None:
          #     key = self.key_downsample(key)
          #     value = self.key_downsample(value)
          key = key.reshape(*key.shape[:2], -1)   #B,C,h*w
          value = value.reshape(*value.shape[:2], -1) #B,C,h*w
          value = value.permute(0, 2, 1).contiguous() #B,h*w,C
  
          sim_map = torch.matmul(query, key)#B,H*W,h*w
          if self.matmul_norm:
              sim_map = (self.map_dim**-.5) * sim_map
          sim_map = F.softmax(sim_map, dim=-1)
  
          context = torch.matmul(sim_map, value)#B,H*W,C
          context = context.permute(0, 2, 1).contiguous()#B,C,H*W
          context = context.reshape(batch_size, -1, *query_feats.shape[2:])#B,C,H,W
          if self.out_project is not None:
              context = self.out_project(context)
          return context
  
  
  
  # class BGA(nn.Module):
  #     def __init__(self, in_dim):
  #         super(BGA, self).__init__()
  #         self.in_dim = in_dim
  #         self.db_dwconv = conv2d(in_dim, in_dim, 3, 1, 1, in_dim, use_rl=False)
  #         self.db_conv1x1 = conv2d(in_dim, in_dim, 1, 0, 1, use_rl=False, use_bn=False)
  #         self.db_conv = conv2d(in_dim, in_dim, 3, 1, 2, use_rl=False)
  #         self.db_apooling = nn.AvgPool2d(3, 2, 1)
  #
  #         self.sb_dwconv = conv2d(in_dim, in_dim, 3, 1, 1, in_dim, use_rl=False)
  #         self.sb_conv1x1 = conv2d(in_dim, in_dim, 1, 0, 1, use_rl=False, use_bn=False)
  #         self.sb_conv = conv2d(in_dim, in_dim, 3, 1, 1, use_rl=False)
  #         self.sb_sigmoid = nn.Sigmoid()
  #
  #         self.conv = conv2d(in_dim, in_dim, 3, 1, 1, use_rl=False)
  #
  #     def forward(self, db, sb):
  #         db_dwc = self.db_dwconv(db)
  #         db_out = self.db_conv1x1(db_dwc)  #
  #         db_conv = self.db_conv(db)
  #         db_pool = self.db_apooling(db_conv)
  #
  #         sb_dwc = self.sb_dwconv(sb)
  #         sb_out = self.sb_sigmoid(self.sb_conv1x1(sb_dwc))  #
  #         sb_conv = self.sb_conv(sb)
  #         sb_up = self.sb_sigmoid(F.interpolate(sb_conv, size=db_out.size()[2:], mode="bilinear", align_corners=True))
  #         db_l = db_out * sb_up
  #         sb_r = F.interpolate(sb_out * db_pool, size=db_out.size()[2:], mode="bilinear", align_corners=True)
  #         res = self.conv(db_l + sb_r)
  #         return res
  
  
  class SegHead(nn.Module):
      def __init__(self, in_dim, out_dim, classes):
          super(SegHead, self).__init__()
          # self.size = size
          self.conv = conv2d(in_dim, out_dim, 3, 1, 1)
          self.classes = conv2d(out_dim, classes, 1, 0, 1, use_bn=False, use_rl=False)
  
      def forward(self, feat,size):
          x = self.conv(feat)
          x = self.classes(x)
          pred = F.interpolate(x, size=size, mode="bilinear", align_corners=True)
          return pred
  
  
  class DetailedBranch(nn.Module):
      def __init__(self):
          super(DetailedBranch, self).__init__()
          self.s1_conv1 = conv2d(3, 64, 3, 1, 2)
          self.s1_conv2 = conv2d(64, 64, 3, 1, 1)
  
          self.s2_conv1 = conv2d(64, 64, 3, 1, 2)
          self.s2_conv2 = conv2d(64, 64, 3, 1, 1)
          self.s2_conv3 = conv2d(64, 64, 3, 1, 1)
  
          self.s3_conv1 = conv2d(64, 128, 3, 1, 2)
          self.s3_conv2 = conv2d(128, 128, 3, 1, 1)
          self.s3_conv3 = conv2d(128, 128, 3, 1, 1)
  
      def forward(self, bottom):
          s1_1 = self.s1_conv1(bottom)
          s1_2 = self.s1_conv2(s1_1)
  
          s2_1 = self.s2_conv1(s1_2)
          s2_2 = self.s2_conv2(s2_1)
          s2_3 = self.s2_conv3(s2_2)
  
          s3_1 = self.s3_conv1(s2_3)
          s3_2 = self.s3_conv2(s3_1)
          s3_3 = self.s3_conv3(s3_2)
          return s3_3
  
  
  class SemanticBranch(nn.Module):
      def __init__(self, classes):
          super(SemanticBranch, self).__init__()
          # self.training = True
          self.stem = StemBlock()
          self.s3_ge1 = GatherExpansion(16, 32, 2)
          self.s3_ge2 = GatherExpansion(32, 32)
  
          self.s4_ge1 = GatherExpansion(32, 64, 2)
          self.s4_ge2 = GatherExpansion(64, 64)
  
          self.s5_ge1 = GatherExpansion(64, 128, 2)
          self.s5_ge2 = GatherExpansion(128, 128)
          self.s5_ge3 = GatherExpansion(128, 128)
          self.s5_ge4 = GatherExpansion(128, 128)
          self.s5_ge5 = GatherExpansion(128, 128, exp=1)
          # if self.training:
          self.seghead1 = SegHead(16, 16, classes)
          self.seghead2 = SegHead(32, 32, classes)
          self.seghead3 = SegHead(64, 64, classes)
          self.seghead4 = SegHead(128, 128, classes)
  
          self.ceb = ContextEmbeddingBlock(128)
  
      def forward(self, bottom, size):
          stg12 = self.stem(bottom)
          # print(stg12.size())
          stg3 = self.s3_ge1(stg12)
          stg3 = self.s3_ge2(stg3)
          # print(stg3.size())
          stg4 = self.s4_ge1(stg3)
          stg4 = self.s4_ge2(stg4)
          # print(stg4.size())
          stg5 = self.s5_ge1(stg4)
          stg5 = self.s5_ge2(stg5)
          stg5 = self.s5_ge3(stg5)
          stg5 = self.s5_ge4(stg5)
          stg5 = self.s5_ge5(stg5)
          # print(stg5.size())
          out = self.ceb(stg5)
          # if self.training:
          seghead1 = self.seghead1(stg12,size)
          seghead2 = self.seghead2(stg3,size)
          seghead3 = self.seghead3(stg4,size)
          seghead4 = self.seghead4(stg5,size)
          return out, seghead1, seghead2, seghead3, seghead4
          # else:
          #     return out
  
  
  class BiSeNetV2AI2(nn.Module):
      def __init__(self, classes):
          super(BiSeNetV2AI2, self).__init__()
          # self.training = True
          self.db = DetailedBranch()
          self.sb = SemanticBranch(classes)
          # self.bga = BGA(128)
          self.dsma = GGMA((44,60), (11,15),128,16,True)
          self.ddma = GGMA((44,60), (44,60), 128, 16, True)
          self.sdma = GGMA((11,15), (44,60),128,16,True)
          self.ssma = GGMA((11,15), (11,15), 128, 16, True)
          self.seghead = SegHead(128, 128, classes)
          self._init_params()
          # self.criterion = nn.CrossEntropyLoss(ignore_index=255)
  
      def _init_params(self):
          for m in self.modules():
              if isinstance(m, nn.Conv2d):
                  nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu')
                  if m.bias is not None:
                      nn.init.constant_(m.bias, 0)
              elif isinstance(m, nn.BatchNorm2d):
                  nn.init.constant_(m.weight, 1)
                  nn.init.constant_(m.bias, 0)
              elif isinstance(m, nn.BatchNorm1d):
                  nn.init.constant_(m.weight, 1)
                  nn.init.constant_(m.bias, 0)
              elif isinstance(m, nn.Linear):
                  nn.init.normal_(m.weight, 0, 0.01)
                  if m.bias is not None:
                      nn.init.constant_(m.bias, 0)
  
      def forward(self, data, y=None):
          size = data.size()[2:]
          db = self.db(data)
  
          # if self.training:
          sb, head1, head2, head3, head4 = self.sb(data,size)
          # else:
          #     sb = self.sb(data,size)
          # bga = self.bga(db, sb)
          # pred = self.seghead(bga,size)
          ddma = self.ddma(db,db)
          dsma = self.dsma(db,sb)
          ssma = self.ssma(sb,sb)
          sdma = self.sdma(sb,db)
          db = db+dsma+ddma
          sb = sb+ssma+sdma
          sb_up = F.interpolate(sb, size=db.size()[2:], mode="bilinear", align_corners=True)
          pred = self.seghead(db+sb_up,size)
          # if self.training:
          #     main_loss = self.criterion(pred, y)
          #     aux1_loss = self.criterion(head1, y)
          #     aux2_loss = self.criterion(head2, y)
          #     aux3_loss = self.criterion(head3, y)
          #     aux4_loss = self.criterion(head4, y)
          #     return pred.max(1)[1], main_loss, (aux1_loss, aux2_loss, aux3_loss, aux4_loss)
          return [pred,head1, head2, head3, head4]
  
  if __name__ == "__main__":
      device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
      model = BiSeNetV2AI2(classes=11).to(device)
      summary(model,(3, 352, 480))
  
      flops_count, params_count = get_model_complexity_info(model, (3, 352, 480),
                                                            as_strings=False,
                                                            print_per_layer_stat=True)
      print(flops_count/1000000000,'GMac', params_count/1000000, params_count/1024/1024*4,'MB')
  
      x = torch.randn(2, 3, 352, 480).to(device)
      input = x
      macs, params = profile(model, inputs=(input,))
      print(macs/2000000000,'GMac', params/1000000, params/1024/1024*4,'MB')
  
      # from fvcore.nn.jit_handles import batchnorm_flop_jit
      # from fvcore.nn.jit_handles import generic_activation_jit
      #
      # supported_ops = {
      #     "aten::batch_norm": batchnorm_flop_jit,
      # }
      # flop_dict, _ = flop_count(model, (x,), supported_ops)
      # print(flop_dict)
  '''
  /home/ethan/anaconda3/envs/py36_cuda101/bin/python /home/ethan/codes/Efficient-Segmentation-Networks/model/BiSeNetV2AI2.py
  ----------------------------------------------------------------
          Layer (type)               Output Shape         Param #
  ================================================================
              Conv2d-1         [-1, 64, 176, 240]           1,728
         BatchNorm2d-2         [-1, 64, 176, 240]             128
                ReLU-3         [-1, 64, 176, 240]               0
              conv2d-4         [-1, 64, 176, 240]               0
              Conv2d-5         [-1, 64, 176, 240]          36,864
         BatchNorm2d-6         [-1, 64, 176, 240]             128
                ReLU-7         [-1, 64, 176, 240]               0
              conv2d-8         [-1, 64, 176, 240]               0
              Conv2d-9          [-1, 64, 88, 120]          36,864
        BatchNorm2d-10          [-1, 64, 88, 120]             128
               ReLU-11          [-1, 64, 88, 120]               0
             conv2d-12          [-1, 64, 88, 120]               0
             Conv2d-13          [-1, 64, 88, 120]          36,864
        BatchNorm2d-14          [-1, 64, 88, 120]             128
               ReLU-15          [-1, 64, 88, 120]               0
             conv2d-16          [-1, 64, 88, 120]               0
             Conv2d-17          [-1, 64, 88, 120]          36,864
        BatchNorm2d-18          [-1, 64, 88, 120]             128
               ReLU-19          [-1, 64, 88, 120]               0
             conv2d-20          [-1, 64, 88, 120]               0
             Conv2d-21          [-1, 128, 44, 60]          73,728
        BatchNorm2d-22          [-1, 128, 44, 60]             256
               ReLU-23          [-1, 128, 44, 60]               0
             conv2d-24          [-1, 128, 44, 60]               0
             Conv2d-25          [-1, 128, 44, 60]         147,456
        BatchNorm2d-26          [-1, 128, 44, 60]             256
               ReLU-27          [-1, 128, 44, 60]               0
             conv2d-28          [-1, 128, 44, 60]               0
             Conv2d-29          [-1, 128, 44, 60]         147,456
        BatchNorm2d-30          [-1, 128, 44, 60]             256
               ReLU-31          [-1, 128, 44, 60]               0
             conv2d-32          [-1, 128, 44, 60]               0
     DetailedBranch-33          [-1, 128, 44, 60]               0
             Conv2d-34         [-1, 16, 176, 240]             432
        BatchNorm2d-35         [-1, 16, 176, 240]              32
               ReLU-36         [-1, 16, 176, 240]               0
             conv2d-37         [-1, 16, 176, 240]               0
             Conv2d-38          [-1, 8, 176, 240]             128
        BatchNorm2d-39          [-1, 8, 176, 240]              16
               ReLU-40          [-1, 8, 176, 240]               0
             conv2d-41          [-1, 8, 176, 240]               0
             Conv2d-42          [-1, 16, 88, 120]           1,152
        BatchNorm2d-43          [-1, 16, 88, 120]              32
               ReLU-44          [-1, 16, 88, 120]               0
             conv2d-45          [-1, 16, 88, 120]               0
          MaxPool2d-46          [-1, 16, 88, 120]               0
             Conv2d-47          [-1, 16, 88, 120]           4,608
        BatchNorm2d-48          [-1, 16, 88, 120]              32
               ReLU-49          [-1, 16, 88, 120]               0
             conv2d-50          [-1, 16, 88, 120]               0
          StemBlock-51          [-1, 16, 88, 120]               0
             Conv2d-52          [-1, 96, 88, 120]          13,824
        BatchNorm2d-53          [-1, 96, 88, 120]             192
               ReLU-54          [-1, 96, 88, 120]               0
             conv2d-55          [-1, 96, 88, 120]               0
             Conv2d-56           [-1, 96, 44, 60]             864
        BatchNorm2d-57           [-1, 96, 44, 60]             192
             conv2d-58           [-1, 96, 44, 60]               0
             Conv2d-59           [-1, 16, 44, 60]             144
        BatchNorm2d-60           [-1, 16, 44, 60]              32
             conv2d-61           [-1, 16, 44, 60]               0
             Conv2d-62           [-1, 32, 44, 60]             512
        BatchNorm2d-63           [-1, 32, 44, 60]              64
             conv2d-64           [-1, 32, 44, 60]               0
             Conv2d-65           [-1, 96, 44, 60]             864
        BatchNorm2d-66           [-1, 96, 44, 60]             192
             conv2d-67           [-1, 96, 44, 60]               0
             Conv2d-68           [-1, 32, 44, 60]           3,072
        BatchNorm2d-69           [-1, 32, 44, 60]              64
             conv2d-70           [-1, 32, 44, 60]               0
               ReLU-71           [-1, 32, 44, 60]               0
    GatherExpansion-72           [-1, 32, 44, 60]               0
             Conv2d-73          [-1, 192, 44, 60]          55,296
        BatchNorm2d-74          [-1, 192, 44, 60]             384
               ReLU-75          [-1, 192, 44, 60]               0
             conv2d-76          [-1, 192, 44, 60]               0
             Conv2d-77          [-1, 192, 44, 60]           1,728
        BatchNorm2d-78          [-1, 192, 44, 60]             384
             conv2d-79          [-1, 192, 44, 60]               0
             Conv2d-80           [-1, 32, 44, 60]           6,144
        BatchNorm2d-81           [-1, 32, 44, 60]              64
             conv2d-82           [-1, 32, 44, 60]               0
               ReLU-83           [-1, 32, 44, 60]               0
    GatherExpansion-84           [-1, 32, 44, 60]               0
             Conv2d-85          [-1, 192, 44, 60]          55,296
        BatchNorm2d-86          [-1, 192, 44, 60]             384
               ReLU-87          [-1, 192, 44, 60]               0
             conv2d-88          [-1, 192, 44, 60]               0
             Conv2d-89          [-1, 192, 22, 30]           1,728
        BatchNorm2d-90          [-1, 192, 22, 30]             384
             conv2d-91          [-1, 192, 22, 30]               0
             Conv2d-92           [-1, 32, 22, 30]             288
        BatchNorm2d-93           [-1, 32, 22, 30]              64
             conv2d-94           [-1, 32, 22, 30]               0
             Conv2d-95           [-1, 64, 22, 30]           2,048
        BatchNorm2d-96           [-1, 64, 22, 30]             128
             conv2d-97           [-1, 64, 22, 30]               0
             Conv2d-98          [-1, 192, 22, 30]           1,728
        BatchNorm2d-99          [-1, 192, 22, 30]             384
            conv2d-100          [-1, 192, 22, 30]               0
            Conv2d-101           [-1, 64, 22, 30]          12,288
       BatchNorm2d-102           [-1, 64, 22, 30]             128
            conv2d-103           [-1, 64, 22, 30]               0
              ReLU-104           [-1, 64, 22, 30]               0
   GatherExpansion-105           [-1, 64, 22, 30]               0
            Conv2d-106          [-1, 384, 22, 30]         221,184
       BatchNorm2d-107          [-1, 384, 22, 30]             768
              ReLU-108          [-1, 384, 22, 30]               0
            conv2d-109          [-1, 384, 22, 30]               0
            Conv2d-110          [-1, 384, 22, 30]           3,456
       BatchNorm2d-111          [-1, 384, 22, 30]             768
            conv2d-112          [-1, 384, 22, 30]               0
            Conv2d-113           [-1, 64, 22, 30]          24,576
       BatchNorm2d-114           [-1, 64, 22, 30]             128
            conv2d-115           [-1, 64, 22, 30]               0
              ReLU-116           [-1, 64, 22, 30]               0
   GatherExpansion-117           [-1, 64, 22, 30]               0
            Conv2d-118          [-1, 384, 22, 30]         221,184
       BatchNorm2d-119          [-1, 384, 22, 30]             768
              ReLU-120          [-1, 384, 22, 30]               0
            conv2d-121          [-1, 384, 22, 30]               0
            Conv2d-122          [-1, 384, 11, 15]           3,456
       BatchNorm2d-123          [-1, 384, 11, 15]             768
            conv2d-124          [-1, 384, 11, 15]               0
            Conv2d-125           [-1, 64, 11, 15]             576
       BatchNorm2d-126           [-1, 64, 11, 15]             128
            conv2d-127           [-1, 64, 11, 15]               0
            Conv2d-128          [-1, 128, 11, 15]           8,192
       BatchNorm2d-129          [-1, 128, 11, 15]             256
            conv2d-130          [-1, 128, 11, 15]               0
            Conv2d-131          [-1, 384, 11, 15]           3,456
       BatchNorm2d-132          [-1, 384, 11, 15]             768
            conv2d-133          [-1, 384, 11, 15]               0
            Conv2d-134          [-1, 128, 11, 15]          49,152
       BatchNorm2d-135          [-1, 128, 11, 15]             256
            conv2d-136          [-1, 128, 11, 15]               0
              ReLU-137          [-1, 128, 11, 15]               0
   GatherExpansion-138          [-1, 128, 11, 15]               0
            Conv2d-139          [-1, 768, 11, 15]         884,736
       BatchNorm2d-140          [-1, 768, 11, 15]           1,536
              ReLU-141          [-1, 768, 11, 15]               0
            conv2d-142          [-1, 768, 11, 15]               0
            Conv2d-143          [-1, 768, 11, 15]           6,912
       BatchNorm2d-144          [-1, 768, 11, 15]           1,536
            conv2d-145          [-1, 768, 11, 15]               0
            Conv2d-146          [-1, 128, 11, 15]          98,304
       BatchNorm2d-147          [-1, 128, 11, 15]             256
            conv2d-148          [-1, 128, 11, 15]               0
              ReLU-149          [-1, 128, 11, 15]               0
   GatherExpansion-150          [-1, 128, 11, 15]               0
            Conv2d-151          [-1, 768, 11, 15]         884,736
       BatchNorm2d-152          [-1, 768, 11, 15]           1,536
              ReLU-153          [-1, 768, 11, 15]               0
            conv2d-154          [-1, 768, 11, 15]               0
            Conv2d-155          [-1, 768, 11, 15]           6,912
       BatchNorm2d-156          [-1, 768, 11, 15]           1,536
            conv2d-157          [-1, 768, 11, 15]               0
            Conv2d-158          [-1, 128, 11, 15]          98,304
       BatchNorm2d-159          [-1, 128, 11, 15]             256
            conv2d-160          [-1, 128, 11, 15]               0
              ReLU-161          [-1, 128, 11, 15]               0
   GatherExpansion-162          [-1, 128, 11, 15]               0
            Conv2d-163          [-1, 768, 11, 15]         884,736
       BatchNorm2d-164          [-1, 768, 11, 15]           1,536
              ReLU-165          [-1, 768, 11, 15]               0
            conv2d-166          [-1, 768, 11, 15]               0
            Conv2d-167          [-1, 768, 11, 15]           6,912
       BatchNorm2d-168          [-1, 768, 11, 15]           1,536
            conv2d-169          [-1, 768, 11, 15]               0
            Conv2d-170          [-1, 128, 11, 15]          98,304
       BatchNorm2d-171          [-1, 128, 11, 15]             256
            conv2d-172          [-1, 128, 11, 15]               0
              ReLU-173          [-1, 128, 11, 15]               0
   GatherExpansion-174          [-1, 128, 11, 15]               0
            Conv2d-175          [-1, 128, 11, 15]         147,456
       BatchNorm2d-176          [-1, 128, 11, 15]             256
              ReLU-177          [-1, 128, 11, 15]               0
            conv2d-178          [-1, 128, 11, 15]               0
            Conv2d-179          [-1, 128, 11, 15]           1,152
       BatchNorm2d-180          [-1, 128, 11, 15]             256
            conv2d-181          [-1, 128, 11, 15]               0
            Conv2d-182          [-1, 128, 11, 15]          16,384
       BatchNorm2d-183          [-1, 128, 11, 15]             256
            conv2d-184          [-1, 128, 11, 15]               0
              ReLU-185          [-1, 128, 11, 15]               0
   GatherExpansion-186          [-1, 128, 11, 15]               0
  AdaptiveAvgPool2d-187            [-1, 128, 1, 1]               0
       BatchNorm2d-188            [-1, 128, 1, 1]             256
            Conv2d-189            [-1, 128, 1, 1]          16,384
       BatchNorm2d-190            [-1, 128, 1, 1]             256
              ReLU-191            [-1, 128, 1, 1]               0
            conv2d-192            [-1, 128, 1, 1]               0
            Conv2d-193          [-1, 128, 11, 15]         147,456
            conv2d-194          [-1, 128, 11, 15]               0
  ContextEmbeddingBlock-195          [-1, 128, 11, 15]               0
            Conv2d-196          [-1, 16, 88, 120]           2,304
       BatchNorm2d-197          [-1, 16, 88, 120]              32
              ReLU-198          [-1, 16, 88, 120]               0
            conv2d-199          [-1, 16, 88, 120]               0
            Conv2d-200          [-1, 11, 88, 120]             176
            conv2d-201          [-1, 11, 88, 120]               0
           SegHead-202         [-1, 11, 352, 480]               0
            Conv2d-203           [-1, 32, 44, 60]           9,216
       BatchNorm2d-204           [-1, 32, 44, 60]              64
              ReLU-205           [-1, 32, 44, 60]               0
            conv2d-206           [-1, 32, 44, 60]               0
            Conv2d-207           [-1, 11, 44, 60]             352
            conv2d-208           [-1, 11, 44, 60]               0
           SegHead-209         [-1, 11, 352, 480]               0
            Conv2d-210           [-1, 64, 22, 30]          36,864
       BatchNorm2d-211           [-1, 64, 22, 30]             128
              ReLU-212           [-1, 64, 22, 30]               0
            conv2d-213           [-1, 64, 22, 30]               0
            Conv2d-214           [-1, 11, 22, 30]             704
            conv2d-215           [-1, 11, 22, 30]               0
           SegHead-216         [-1, 11, 352, 480]               0
            Conv2d-217          [-1, 128, 11, 15]         147,456
       BatchNorm2d-218          [-1, 128, 11, 15]             256
              ReLU-219          [-1, 128, 11, 15]               0
            conv2d-220          [-1, 128, 11, 15]               0
            Conv2d-221           [-1, 11, 11, 15]           1,408
            conv2d-222           [-1, 11, 11, 15]               0
           SegHead-223         [-1, 11, 352, 480]               0
    SemanticBranch-224  [[-1, 128, 11, 15], [-1, 11, 352, 480], [-1, 11, 352, 480], [-1, 11, 352, 480], [-1, 11, 352, 480]]               0
            Conv2d-225           [-1, 16, 44, 60]           2,080
       BatchNorm2d-226           [-1, 16, 44, 60]              32
              ReLU-227           [-1, 16, 44, 60]               0
            conv2d-228           [-1, 16, 44, 60]               0
            Conv2d-229           [-1, 16, 44, 60]           2,080
       BatchNorm2d-230           [-1, 16, 44, 60]              32
              ReLU-231           [-1, 16, 44, 60]               0
            conv2d-232           [-1, 16, 44, 60]               0
            Conv2d-233           [-1, 16, 44, 60]           2,048
       BatchNorm2d-234           [-1, 16, 44, 60]              32
              ReLU-235           [-1, 16, 44, 60]               0
            conv2d-236           [-1, 16, 44, 60]               0
            Conv2d-237          [-1, 128, 44, 60]           2,048
       BatchNorm2d-238          [-1, 128, 44, 60]             256
              ReLU-239          [-1, 128, 44, 60]               0
            conv2d-240          [-1, 128, 44, 60]               0
              GGMA-241          [-1, 128, 44, 60]               0
            Conv2d-242           [-1, 16, 44, 60]           2,080
       BatchNorm2d-243           [-1, 16, 44, 60]              32
              ReLU-244           [-1, 16, 44, 60]               0
            conv2d-245           [-1, 16, 44, 60]               0
            Conv2d-246           [-1, 16, 11, 15]           2,080
       BatchNorm2d-247           [-1, 16, 11, 15]              32
              ReLU-248           [-1, 16, 11, 15]               0
            conv2d-249           [-1, 16, 11, 15]               0
            Conv2d-250           [-1, 16, 11, 15]           2,048
       BatchNorm2d-251           [-1, 16, 11, 15]              32
              ReLU-252           [-1, 16, 11, 15]               0
            conv2d-253           [-1, 16, 11, 15]               0
            Conv2d-254          [-1, 128, 44, 60]           2,048
       BatchNorm2d-255          [-1, 128, 44, 60]             256
              ReLU-256          [-1, 128, 44, 60]               0
            conv2d-257          [-1, 128, 44, 60]               0
              GGMA-258          [-1, 128, 44, 60]               0
            Conv2d-259           [-1, 16, 11, 15]           2,080
       BatchNorm2d-260           [-1, 16, 11, 15]              32
              ReLU-261           [-1, 16, 11, 15]               0
            conv2d-262           [-1, 16, 11, 15]               0
            Conv2d-263           [-1, 16, 11, 15]           2,080
       BatchNorm2d-264           [-1, 16, 11, 15]              32
              ReLU-265           [-1, 16, 11, 15]               0
            conv2d-266           [-1, 16, 11, 15]               0
            Conv2d-267           [-1, 16, 11, 15]           2,048
       BatchNorm2d-268           [-1, 16, 11, 15]              32
              ReLU-269           [-1, 16, 11, 15]               0
            conv2d-270           [-1, 16, 11, 15]               0
            Conv2d-271          [-1, 128, 11, 15]           2,048
       BatchNorm2d-272          [-1, 128, 11, 15]             256
              ReLU-273          [-1, 128, 11, 15]               0
            conv2d-274          [-1, 128, 11, 15]               0
              GGMA-275          [-1, 128, 11, 15]               0
            Conv2d-276           [-1, 16, 11, 15]           2,080
       BatchNorm2d-277           [-1, 16, 11, 15]              32
              ReLU-278           [-1, 16, 11, 15]               0
            conv2d-279           [-1, 16, 11, 15]               0
            Conv2d-280           [-1, 16, 44, 60]           2,080
       BatchNorm2d-281           [-1, 16, 44, 60]              32
              ReLU-282           [-1, 16, 44, 60]               0
            conv2d-283           [-1, 16, 44, 60]               0
            Conv2d-284           [-1, 16, 44, 60]           2,048
       BatchNorm2d-285           [-1, 16, 44, 60]              32
              ReLU-286           [-1, 16, 44, 60]               0
            conv2d-287           [-1, 16, 44, 60]               0
            Conv2d-288          [-1, 128, 11, 15]           2,048
       BatchNorm2d-289          [-1, 128, 11, 15]             256
              ReLU-290          [-1, 128, 11, 15]               0
            conv2d-291          [-1, 128, 11, 15]               0
              GGMA-292          [-1, 128, 11, 15]               0
            Conv2d-293          [-1, 128, 44, 60]         147,456
       BatchNorm2d-294          [-1, 128, 44, 60]             256
              ReLU-295          [-1, 128, 44, 60]               0
            conv2d-296          [-1, 128, 44, 60]               0
            Conv2d-297           [-1, 11, 44, 60]           1,408
            conv2d-298           [-1, 11, 44, 60]               0
           SegHead-299         [-1, 11, 352, 480]               0
  ================================================================
  Total params: 4,916,832
  Trainable params: 4,916,832
  Non-trainable params: 0
  ----------------------------------------------------------------
  Input size (MB): 1.93
  Forward/backward pass size (MB): 62196495155789.24
  Params size (MB): 18.76
  Estimated Total Size (MB): 62196495155809.94
  ----------------------------------------------------------------
  BiSeNetV2AI2(
    5.793 GMac, 100.000% MACs, 
    (db): DetailedBranch(
      3.797 GMac, 65.536% MACs, 
      (s1_conv1): conv2d(
        0.081 GMac, 1.400% MACs, 
        (conv): Conv2d(0.073 GMac, 1.260% MACs, 3, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
        (bn): BatchNorm2d(0.005 GMac, 0.093% MACs, 64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.003 GMac, 0.047% MACs, inplace=True)
      )
      (s1_conv2): conv2d(
        1.565 GMac, 27.019% MACs, 
        (conv): Conv2d(1.557 GMac, 26.879% MACs, 64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn): BatchNorm2d(0.005 GMac, 0.093% MACs, 64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.003 GMac, 0.047% MACs, inplace=True)
      )
      (s2_conv1): conv2d(
        0.391 GMac, 6.755% MACs, 
        (conv): Conv2d(0.389 GMac, 6.720% MACs, 64, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
        (bn): BatchNorm2d(0.001 GMac, 0.023% MACs, 64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.001 GMac, 0.012% MACs, inplace=True)
      )
      (s2_conv2): conv2d(
        0.391 GMac, 6.755% MACs, 
        (conv): Conv2d(0.389 GMac, 6.720% MACs, 64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn): BatchNorm2d(0.001 GMac, 0.023% MACs, 64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.001 GMac, 0.012% MACs, inplace=True)
      )
      (s2_conv3): conv2d(
        0.391 GMac, 6.755% MACs, 
        (conv): Conv2d(0.389 GMac, 6.720% MACs, 64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn): BatchNorm2d(0.001 GMac, 0.023% MACs, 64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.001 GMac, 0.012% MACs, inplace=True)
      )
      (s3_conv1): conv2d(
        0.196 GMac, 3.377% MACs, 
        (conv): Conv2d(0.195 GMac, 3.360% MACs, 64, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
        (bn): BatchNorm2d(0.001 GMac, 0.012% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.006% MACs, inplace=True)
      )
      (s3_conv2): conv2d(
        0.39 GMac, 6.737% MACs, 
        (conv): Conv2d(0.389 GMac, 6.720% MACs, 128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn): BatchNorm2d(0.001 GMac, 0.012% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.006% MACs, inplace=True)
      )
      (s3_conv3): conv2d(
        0.39 GMac, 6.737% MACs, 
        (conv): Conv2d(0.389 GMac, 6.720% MACs, 128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn): BatchNorm2d(0.001 GMac, 0.012% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.006% MACs, inplace=True)
      )
    )
    (sb): SemanticBranch(
      1.553 GMac, 26.812% MACs, 
      (stem): StemBlock(
        0.089 GMac, 1.540% MACs, 
        (conv1): conv2d(
          0.02 GMac, 0.350% MACs, 
          (conv): Conv2d(0.018 GMac, 0.315% MACs, 3, 16, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.001 GMac, 0.023% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.001 GMac, 0.012% MACs, inplace=True)
        )
        (conv_1x1): conv2d(
          0.006 GMac, 0.111% MACs, 
          (conv): Conv2d(0.005 GMac, 0.093% MACs, 16, 8, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.001 GMac, 0.012% MACs, 8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.006% MACs, inplace=True)
        )
        (conv_3x3): conv2d(
          0.013 GMac, 0.219% MACs, 
          (conv): Conv2d(0.012 GMac, 0.210% MACs, 8, 16, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.006% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.003% MACs, inplace=True)
        )
        (mpooling): MaxPool2d(0.001 GMac, 0.012% MACs, kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
        (conv2): conv2d(
          0.049 GMac, 0.849% MACs, 
          (conv): Conv2d(0.049 GMac, 0.840% MACs, 32, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.006% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.003% MACs, inplace=True)
        )
      )
      (s3_ge1): GatherExpansion(
        0.165 GMac, 2.847% MACs, 
        (conv1): conv2d(
          0.149 GMac, 2.572% MACs, 
          (conv): Conv2d(0.146 GMac, 2.520% MACs, 16, 96, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.002 GMac, 0.035% MACs, 96, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.001 GMac, 0.017% MACs, inplace=True)
        )
        (dwconv2): conv2d(
          0.003 GMac, 0.048% MACs, 
          (conv): Conv2d(0.002 GMac, 0.039% MACs, 96, 96, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=96, bias=False)
          (bn): BatchNorm2d(0.001 GMac, 0.009% MACs, 96, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_11): conv2d(
          0.008 GMac, 0.143% MACs, 
          (conv): Conv2d(0.008 GMac, 0.140% MACs, 96, 32, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.003% MACs, 32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv1): conv2d(
          0.003 GMac, 0.048% MACs, 
          (conv): Conv2d(0.002 GMac, 0.039% MACs, 96, 96, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=96, bias=False)
          (bn): BatchNorm2d(0.001 GMac, 0.009% MACs, 96, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv3): conv2d(
          0.0 GMac, 0.008% MACs, 
          (conv): Conv2d(0.0 GMac, 0.007% MACs, 16, 16, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=16, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_12): conv2d(
          0.002 GMac, 0.026% MACs, 
          (conv): Conv2d(0.001 GMac, 0.023% MACs, 16, 32, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.003% MACs, 32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (relu): ReLU(0.0 GMac, 0.001% MACs, inplace=True)
      )
      (s3_ge2): GatherExpansion(
        0.17 GMac, 2.927% MACs, 
        (conv1): conv2d(
          0.148 GMac, 2.546% MACs, 
          (conv): Conv2d(0.146 GMac, 2.520% MACs, 32, 192, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.001 GMac, 0.017% MACs, 192, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.001 GMac, 0.009% MACs, inplace=True)
        )
        (dwconv2): conv2d(
          0.006 GMac, 0.096% MACs, 
          (conv): Conv2d(0.005 GMac, 0.079% MACs, 192, 192, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=192, bias=False)
          (bn): BatchNorm2d(0.001 GMac, 0.017% MACs, 192, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_11): conv2d(
          0.016 GMac, 0.283% MACs, 
          (conv): Conv2d(0.016 GMac, 0.280% MACs, 192, 32, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.003% MACs, 32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv1): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 192, 192, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=192, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 192, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv3): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 32, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=32, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_12): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 32, 32, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (relu): ReLU(0.0 GMac, 0.001% MACs, inplace=True)
      )
      (s4_ge1): GatherExpansion(
        0.16 GMac, 2.765% MACs, 
        (conv1): conv2d(
          0.148 GMac, 2.546% MACs, 
          (conv): Conv2d(0.146 GMac, 2.520% MACs, 32, 192, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.001 GMac, 0.017% MACs, 192, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.001 GMac, 0.009% MACs, inplace=True)
        )
        (dwconv2): conv2d(
          0.001 GMac, 0.024% MACs, 
          (conv): Conv2d(0.001 GMac, 0.020% MACs, 192, 192, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=192, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.004% MACs, 192, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_11): conv2d(
          0.008 GMac, 0.141% MACs, 
          (conv): Conv2d(0.008 GMac, 0.140% MACs, 192, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv1): conv2d(
          0.001 GMac, 0.024% MACs, 
          (conv): Conv2d(0.001 GMac, 0.020% MACs, 192, 192, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=192, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.004% MACs, 192, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv3): conv2d(
          0.0 GMac, 0.004% MACs, 
          (conv): Conv2d(0.0 GMac, 0.003% MACs, 32, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=32, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_12): conv2d(
          0.001 GMac, 0.025% MACs, 
          (conv): Conv2d(0.001 GMac, 0.023% MACs, 32, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (relu): ReLU(0.0 GMac, 0.001% MACs, inplace=True)
      )
      (s4_ge2): GatherExpansion(
        0.166 GMac, 2.863% MACs, 
        (conv1): conv2d(
          0.147 GMac, 2.533% MACs, 
          (conv): Conv2d(0.146 GMac, 2.520% MACs, 64, 384, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.001 GMac, 0.009% MACs, 384, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.004% MACs, inplace=True)
        )
        (dwconv2): conv2d(
          0.003 GMac, 0.048% MACs, 
          (conv): Conv2d(0.002 GMac, 0.039% MACs, 384, 384, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=384, bias=False)
          (bn): BatchNorm2d(0.001 GMac, 0.009% MACs, 384, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_11): conv2d(
          0.016 GMac, 0.281% MACs, 
          (conv): Conv2d(0.016 GMac, 0.280% MACs, 384, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv1): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 384, 384, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=384, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 384, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv3): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 64, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=64, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_12): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 64, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (relu): ReLU(0.0 GMac, 0.001% MACs, inplace=True)
      )
      (s5_ge1): GatherExpansion(
        0.158 GMac, 2.724% MACs, 
        (conv1): conv2d(
          0.147 GMac, 2.533% MACs, 
          (conv): Conv2d(0.146 GMac, 2.520% MACs, 64, 384, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.001 GMac, 0.009% MACs, 384, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.004% MACs, inplace=True)
        )
        (dwconv2): conv2d(
          0.001 GMac, 0.012% MACs, 
          (conv): Conv2d(0.001 GMac, 0.010% MACs, 384, 384, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=384, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.002% MACs, 384, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_11): conv2d(
          0.008 GMac, 0.141% MACs, 
          (conv): Conv2d(0.008 GMac, 0.140% MACs, 384, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv1): conv2d(
          0.001 GMac, 0.012% MACs, 
          (conv): Conv2d(0.001 GMac, 0.010% MACs, 384, 384, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=384, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.002% MACs, 384, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv3): conv2d(
          0.0 GMac, 0.002% MACs, 
          (conv): Conv2d(0.0 GMac, 0.002% MACs, 64, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=64, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_12): conv2d(
          0.001 GMac, 0.024% MACs, 
          (conv): Conv2d(0.001 GMac, 0.023% MACs, 64, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
      (s5_ge2): GatherExpansion(
        0.164 GMac, 2.832% MACs, 
        (conv1): conv2d(
          0.146 GMac, 2.526% MACs, 
          (conv): Conv2d(0.146 GMac, 2.520% MACs, 128, 768, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.004% MACs, 768, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.002% MACs, inplace=True)
        )
        (dwconv2): conv2d(
          0.001 GMac, 0.024% MACs, 
          (conv): Conv2d(0.001 GMac, 0.020% MACs, 768, 768, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=768, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.004% MACs, 768, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_11): conv2d(
          0.016 GMac, 0.281% MACs, 
          (conv): Conv2d(0.016 GMac, 0.280% MACs, 768, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv1): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 768, 768, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=768, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 768, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv3): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 128, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=128, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_12): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
      (s5_ge3): GatherExpansion(
        0.164 GMac, 2.832% MACs, 
        (conv1): conv2d(
          0.146 GMac, 2.526% MACs, 
          (conv): Conv2d(0.146 GMac, 2.520% MACs, 128, 768, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.004% MACs, 768, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.002% MACs, inplace=True)
        )
        (dwconv2): conv2d(
          0.001 GMac, 0.024% MACs, 
          (conv): Conv2d(0.001 GMac, 0.020% MACs, 768, 768, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=768, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.004% MACs, 768, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_11): conv2d(
          0.016 GMac, 0.281% MACs, 
          (conv): Conv2d(0.016 GMac, 0.280% MACs, 768, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv1): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 768, 768, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=768, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 768, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv3): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 128, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=128, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_12): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
      (s5_ge4): GatherExpansion(
        0.164 GMac, 2.832% MACs, 
        (conv1): conv2d(
          0.146 GMac, 2.526% MACs, 
          (conv): Conv2d(0.146 GMac, 2.520% MACs, 128, 768, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.004% MACs, 768, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.002% MACs, inplace=True)
        )
        (dwconv2): conv2d(
          0.001 GMac, 0.024% MACs, 
          (conv): Conv2d(0.001 GMac, 0.020% MACs, 768, 768, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=768, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.004% MACs, 768, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_11): conv2d(
          0.016 GMac, 0.281% MACs, 
          (conv): Conv2d(0.016 GMac, 0.280% MACs, 768, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv1): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 768, 768, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=768, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 768, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv3): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 128, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=128, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_12): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
      (s5_ge5): GatherExpansion(
        0.027 GMac, 0.473% MACs, 
        (conv1): conv2d(
          0.024 GMac, 0.421% MACs, 
          (conv): Conv2d(0.024 GMac, 0.420% MACs, 128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv2): conv2d(
          0.0 GMac, 0.004% MACs, 
          (conv): Conv2d(0.0 GMac, 0.003% MACs, 128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_11): conv2d(
          0.003 GMac, 0.047% MACs, 
          (conv): Conv2d(0.003 GMac, 0.047% MACs, 128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv1): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 128, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=128, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (dwconv3): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 128, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), groups=128, bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv_12): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
      (seghead1): SegHead(
        0.027 GMac, 0.461% MACs, 
        (conv): conv2d(
          0.025 GMac, 0.429% MACs, 
          (conv): Conv2d(0.024 GMac, 0.420% MACs, 16, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.006% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.003% MACs, inplace=True)
        )
        (classes): conv2d(
          0.002 GMac, 0.032% MACs, 
          (conv): Conv2d(0.002 GMac, 0.032% MACs, 16, 11, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 11, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
      )
      (seghead2): SegHead(
        0.026 GMac, 0.440% MACs, 
        (conv): conv2d(
          0.025 GMac, 0.424% MACs, 
          (conv): Conv2d(0.024 GMac, 0.420% MACs, 32, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.003% MACs, 32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.001% MACs, inplace=True)
        )
        (classes): conv2d(
          0.001 GMac, 0.016% MACs, 
          (conv): Conv2d(0.001 GMac, 0.016% MACs, 32, 11, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 11, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
      )
      (seghead3): SegHead(
        0.025 GMac, 0.430% MACs, 
        (conv): conv2d(
          0.024 GMac, 0.422% MACs, 
          (conv): Conv2d(0.024 GMac, 0.420% MACs, 64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.001% MACs, inplace=True)
        )
        (classes): conv2d(
          0.0 GMac, 0.008% MACs, 
          (conv): Conv2d(0.0 GMac, 0.008% MACs, 64, 11, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 11, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
      )
      (seghead4): SegHead(
        0.025 GMac, 0.425% MACs, 
        (conv): conv2d(
          0.024 GMac, 0.421% MACs, 
          (conv): Conv2d(0.024 GMac, 0.420% MACs, 128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (classes): conv2d(
          0.0 GMac, 0.004% MACs, 
          (conv): Conv2d(0.0 GMac, 0.004% MACs, 128, 11, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 11, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
      )
      (ceb): ContextEmbeddingBlock(
        0.024 GMac, 0.421% MACs, 
        (gap): AdaptiveAvgPool2d(0.0 GMac, 0.000% MACs, output_size=1)
        (bn1): BatchNorm2d(0.0 GMac, 0.000% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (conv1): conv2d(
          0.0 GMac, 0.000% MACs, 
          (conv): Conv2d(0.0 GMac, 0.000% MACs, 128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
        (conv2): conv2d(
          0.024 GMac, 0.420% MACs, 
          (conv): Conv2d(0.024 GMac, 0.420% MACs, 128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
          (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
        )
      )
    )
    (dsma): GGMA(
      0.013 GMac, 0.220% MACs, 
      (query_project): conv2d(
        0.006 GMac, 0.097% MACs, 
        (conv): Conv2d(0.005 GMac, 0.095% MACs, 130, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.001% MACs, inplace=True)
      )
      (key_project): conv2d(
        0.0 GMac, 0.006% MACs, 
        (conv): Conv2d(0.0 GMac, 0.006% MACs, 130, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
      (value_project): conv2d(
        0.0 GMac, 0.006% MACs, 
        (conv): Conv2d(0.0 GMac, 0.006% MACs, 128, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
      (out_project): conv2d(
        0.006 GMac, 0.111% MACs, 
        (conv): Conv2d(0.005 GMac, 0.093% MACs, 16, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.001 GMac, 0.012% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.006% MACs, inplace=True)
      )
    )
    (ddma): GGMA(
      0.023 GMac, 0.400% MACs, 
      (query_project): conv2d(
        0.006 GMac, 0.097% MACs, 
        (conv): Conv2d(0.005 GMac, 0.095% MACs, 130, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.001% MACs, inplace=True)
      )
      (key_project): conv2d(
        0.006 GMac, 0.097% MACs, 
        (conv): Conv2d(0.005 GMac, 0.095% MACs, 130, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.001% MACs, inplace=True)
      )
      (value_project): conv2d(
        0.006 GMac, 0.096% MACs, 
        (conv): Conv2d(0.005 GMac, 0.093% MACs, 128, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.001% MACs, inplace=True)
      )
      (out_project): conv2d(
        0.006 GMac, 0.111% MACs, 
        (conv): Conv2d(0.005 GMac, 0.093% MACs, 16, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.001 GMac, 0.012% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.006% MACs, inplace=True)
      )
    )
    (sdma): GGMA(
      0.012 GMac, 0.205% MACs, 
      (query_project): conv2d(
        0.0 GMac, 0.006% MACs, 
        (conv): Conv2d(0.0 GMac, 0.006% MACs, 130, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
      (key_project): conv2d(
        0.006 GMac, 0.097% MACs, 
        (conv): Conv2d(0.005 GMac, 0.095% MACs, 130, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.001% MACs, inplace=True)
      )
      (value_project): conv2d(
        0.006 GMac, 0.096% MACs, 
        (conv): Conv2d(0.005 GMac, 0.093% MACs, 128, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.001% MACs, inplace=True)
      )
      (out_project): conv2d(
        0.0 GMac, 0.007% MACs, 
        (conv): Conv2d(0.0 GMac, 0.006% MACs, 16, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
    )
    (ssma): GGMA(
      0.001 GMac, 0.025% MACs, 
      (query_project): conv2d(
        0.0 GMac, 0.006% MACs, 
        (conv): Conv2d(0.0 GMac, 0.006% MACs, 130, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
      (key_project): conv2d(
        0.0 GMac, 0.006% MACs, 
        (conv): Conv2d(0.0 GMac, 0.006% MACs, 130, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
      (value_project): conv2d(
        0.0 GMac, 0.006% MACs, 
        (conv): Conv2d(0.0 GMac, 0.006% MACs, 128, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
      (out_project): conv2d(
        0.0 GMac, 0.007% MACs, 
        (conv): Conv2d(0.0 GMac, 0.006% MACs, 16, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.001% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
    )
    (seghead): SegHead(
      0.394 GMac, 6.801% MACs, 
      (conv): conv2d(
        0.39 GMac, 6.737% MACs, 
        (conv): Conv2d(0.389 GMac, 6.720% MACs, 128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn): BatchNorm2d(0.001 GMac, 0.012% MACs, 128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.006% MACs, inplace=True)
      )
      (classes): conv2d(
        0.004 GMac, 0.064% MACs, 
        (conv): Conv2d(0.004 GMac, 0.064% MACs, 128, 11, kernel_size=(1, 1), stride=(1, 1), bias=False)
        (bn): BatchNorm2d(0.0 GMac, 0.000% MACs, 11, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(0.0 GMac, 0.000% MACs, inplace=True)
      )
    )
  )
  5.793058784 GMac 5.028846 19.18352508544922 MB
  [INFO] Register count_convNd() for <class 'torch.nn.modules.conv.Conv2d'>.
  [INFO] Register count_bn() for <class 'torch.nn.modules.batchnorm.BatchNorm2d'>.
  [INFO] Register zero_ops() for <class 'torch.nn.modules.activation.ReLU'>.
  [WARN] Cannot find rule for <class '__main__.conv2d'>. Treat it as zero Macs and zero Params.
  [WARN] Cannot find rule for <class '__main__.DetailedBranch'>. Treat it as zero Macs and zero Params.
  [INFO] Register zero_ops() for <class 'torch.nn.modules.pooling.MaxPool2d'>.
  [WARN] Cannot find rule for <class '__main__.StemBlock'>. Treat it as zero Macs and zero Params.
  [WARN] Cannot find rule for <class '__main__.GatherExpansion'>. Treat it as zero Macs and zero Params.
  [WARN] Cannot find rule for <class '__main__.SegHead'>. Treat it as zero Macs and zero Params.
  [INFO] Register count_adap_avgpool() for <class 'torch.nn.modules.pooling.AdaptiveAvgPool2d'>.
  [WARN] Cannot find rule for <class '__main__.ContextEmbeddingBlock'>. Treat it as zero Macs and zero Params.
  [WARN] Cannot find rule for <class '__main__.SemanticBranch'>. Treat it as zero Macs and zero Params.
  [WARN] Cannot find rule for <class '__main__.GGMA'>. Treat it as zero Macs and zero Params.
  [WARN] Cannot find rule for <class '__main__.BiSeNetV2AI2'>. Treat it as zero Macs and zero Params.
  5.777646464 GMac 4.916832 18.7562255859375 MB
  
  Process finished with exit code 0
  
  
  '''
  
  