def forward(self, data, label=None, aux_label=None):
    blocks = self.backbone(data)
    (fm, intra_sim_map) = self.context(blocks[(- 1)])
    fm = self.head_layer(fm)
    fm = F.interpolate(fm, scale_factor=8, mode='bilinear', align_corners=True)
    softmax_fm = F.log_softmax(fm, dim=1)
    aux_fm = self.aux_layer(blocks[(- 2)])
    aux_fm = F.interpolate(aux_fm, scale_factor=8, mode='bilinear', align_corners=True)
    if (label is not None):
        main_loss = self.criterion(fm, label)
        aux_loss = self.criterion(aux_fm, label)
        intra_sim_loss = self.bce_criterion(intra_sim_map, aux_label)
        loss = ((main_loss + (0.4 * aux_loss)) + intra_sim_loss)
        return loss
    return softmax_fm
def forward(self, data, label=None, aux_label=None):
    blocks = self.backbone(data)
    (fm, intra_sim_map) = self.context(blocks[(- 1)])
    fm = self.head_layer(fm)
    fm = F.interpolate(fm, scale_factor=8, mode='bilinear', align_corners=True)
    softmax_fm = F.log_softmax(fm, dim=1)
    aux_fm = self.aux_layer(blocks[(- 2)])
    aux_fm = F.interpolate(aux_fm, scale_factor=8, mode='bilinear', align_corners=True)
    if (label is not None):
        main_loss = self.criterion(fm, label)
        aux_loss = self.criterion(aux_fm, label)
        intra_sim_loss = self.bce_criterion(intra_sim_map, aux_label)
        loss = ((main_loss + (0.4 * aux_loss)) + intra_sim_loss)
        return loss
    return softmax_fm