(self, x)
return out
:param x: Shape: [b, 2048, h, w]
        :return: out: Feature maps. Shape: [b, 2048, h, w]
:param x: Shape: [b, 2048, h, w]
        :return: out: Feature maps. Shape: [b, 2048, h, w]
: param x : Shape : [ b 2048 h w ] : return : out : Feature maps . Shape : [ b 2048 h w ]
def forward(self, x):
        """
        :param x: Shape: [b, 2048, h, w]
        :return: out: Feature maps. Shape: [b, 2048, h, w]
        """
        # Master branch
        x_master = self.conv_master(x)
        x_master = self.bn_master(x_master)

        # Global pooling branch
        x_gpb = nn.AvgPool2d(x.shape[2:])(x).view(x.shape[0], self.channels_cond, 1, 1)
        x_gpb = self.conv_gpb(x_gpb)
        #x_gpb = self.bn_gpb(x_gpb)

        # Branch 1
        x1_1 = self.conv7x7_1(x)
        x1_1 = self.bn1_1(x1_1)
        x1_1 = self.relu(x1_1)
        x1_2 = self.conv7x7_2(x1_1)
        x1_2 = self.bn1_2(x1_2)

        # Branch 2
        x2_1 = self.conv5x5_1(x1_1)
        x2_1 = self.bn2_1(x2_1)
        x2_1 = self.relu(x2_1)
        x2_2 = self.conv5x5_2(x2_1)
        x2_2 = self.bn2_2(x2_2)

        # Branch 3
        x3_1 = self.conv3x3_1(x2_1)
        x3_1 = self.bn3_1(x3_1)
        x3_1 = self.relu(x3_1)
        x3_2 = self.conv3x3_2(x3_1)
        x3_2 = self.bn3_2(x3_2)

        # Merge branch 1 and 2
        x3_upsample = F.upsample(x3_2, size=x2_2.shape[-2:],
                                 mode='bilinear', align_corners=False)

        x2_merge = self.relu(x2_2 + x3_upsample)

        x2_upsample = F.upsample(x2_merge, size=x1_2.shape[-2:],
                                 mode='bilinear', align_corners=False)
        x1_merge = self.relu(x1_2 + x2_upsample)

        x1_merge_upsample = F.upsample(x1_merge, size=x_master.shape[-2:],
                                       mode='bilinear', align_corners=False)
        x1_merge_upsample_ch = self.relu(self.bn_upsample_1(self.conv1x1_up1(x1_merge_upsample)))
        x_master = x_master * x1_merge_upsample_ch
        #
        out = self.relu(x_master + x_gpb)

        return out
def forward ( self , x ) : # Master branch x_master = self . conv_master ( x ) x_master = self . bn_master ( x_master ) # Global pooling branch x_gpb = nn . AvgPool2d ( x . shape [ 2 : ] ) ( x ) . view ( x . shape [ 0 ] , self . channels_cond , 1 , 1 ) x_gpb = self . conv_gpb ( x_gpb ) #x_gpb = self.bn_gpb(x_gpb) # Branch 1 x1_1 = self . conv7x7_1 ( x ) x1_1 = self . bn1_1 ( x1_1 ) x1_1 = self . relu ( x1_1 ) x1_2 = self . conv7x7_2 ( x1_1 ) x1_2 = self . bn1_2 ( x1_2 ) # Branch 2 x2_1 = self . conv5x5_1 ( x1_1 ) x2_1 = self . bn2_1 ( x2_1 ) x2_1 = self . relu ( x2_1 ) x2_2 = self . conv5x5_2 ( x2_1 ) x2_2 = self . bn2_2 ( x2_2 ) # Branch 3 x3_1 = self . conv3x3_1 ( x2_1 ) x3_1 = self . bn3_1 ( x3_1 ) x3_1 = self . relu ( x3_1 ) x3_2 = self . conv3x3_2 ( x3_1 ) x3_2 = self . bn3_2 ( x3_2 ) # Merge branch 1 and 2 x3_upsample = F . upsample ( x3_2 , size = x2_2 . shape [ - 2 : ] , mode = 'bilinear' , align_corners = False ) x2_merge = self . relu ( x2_2 + x3_upsample ) x2_upsample = F . upsample ( x2_merge , size = x1_2 . shape [ - 2 : ] , mode = 'bilinear' , align_corners = False ) x1_merge = self . relu ( x1_2 + x2_upsample ) x1_merge_upsample = F . upsample ( x1_merge , size = x_master . shape [ - 2 : ] , mode = 'bilinear' , align_corners = False ) x1_merge_upsample_ch = self . relu ( self . bn_upsample_1 ( self . conv1x1_up1 ( x1_merge_upsample ) ) ) x_master = x_master * x1_merge_upsample_ch # out = self . relu ( x_master + x_gpb ) return out