def forward(self, x: torch.Tensor) -> Dict[(str, torch.Tensor)]:
    (detection_sources, head_list) = ([], [])
    x = self.model0(x)
    x = F.max_pool2d(x, 2)
    x = self.model1(x)
    x = self.model2(x)
    x = F.max_pool2d(x, 2)
    x = self.model3(x)
    detection_sources.append(x)
    x = F.max_pool2d(x, 2)
    x = self.model4(x)
    detection_sources.append(x)
    x = F.max_pool2d(x, 2)
    x = self.model5(x)
    detection_sources.append(x)
    x = F.max_pool2d(x, 2)
    x = self.model6(x)
    detection_sources.append(x)
    for (i, h) in enumerate(self.head):
        x_tmp = h(detection_sources[i])
        head_list.append(x_tmp.permute(0, 2, 3, 1).contiguous())
    head_data = torch.cat([o.view(o.size(0), (- 1)) for o in head_list], 1)
    head_data = head_data.view(head_data.size(0), (- 1), 17)
    (loc_data, conf_data, iou_data) = head_data.split((14, 2, 1), dim=(- 1))
    if (self.phase == 'test'):
        loc_data = loc_data.view((- 1), 14)
        conf_data = torch.softmax(conf_data.view((- 1), self.num_classes), dim=(- 1))
        iou_data = iou_data.view((- 1), 1)
    else:
        loc_data = loc_data.view(loc_data.size(0), (- 1), 14)
        conf_data = conf_data.view(conf_data.size(0), (- 1), self.num_classes)
        iou_data = iou_data.view(iou_data.size(0), (- 1), 1)
    return {'loc': loc_data, 'conf': conf_data, 'iou': iou_data}
def forward(self, x: torch.Tensor) -> Dict[(str, torch.Tensor)]:
    (detection_sources, head_list) = ([], [])
    x = self.model0(x)
    x = F.max_pool2d(x, 2)
    x = self.model1(x)
    x = self.model2(x)
    x = F.max_pool2d(x, 2)
    x = self.model3(x)
    detection_sources.append(x)
    x = F.max_pool2d(x, 2)
    x = self.model4(x)
    detection_sources.append(x)
    x = F.max_pool2d(x, 2)
    x = self.model5(x)
    detection_sources.append(x)
    x = F.max_pool2d(x, 2)
    x = self.model6(x)
    detection_sources.append(x)
    for (i, h) in enumerate(self.head):
        x_tmp = h(detection_sources[i])
        head_list.append(x_tmp.permute(0, 2, 3, 1).contiguous())
    head_data = torch.cat([o.view(o.size(0), (- 1)) for o in head_list], 1)
    head_data = head_data.view(head_data.size(0), (- 1), 17)
    (loc_data, conf_data, iou_data) = head_data.split((14, 2, 1), dim=(- 1))
    if (self.phase == 'test'):
        loc_data = loc_data.view((- 1), 14)
        conf_data = torch.softmax(conf_data.view((- 1), self.num_classes), dim=(- 1))
        iou_data = iou_data.view((- 1), 1)
    else:
        loc_data = loc_data.view(loc_data.size(0), (- 1), 14)
        conf_data = conf_data.view(conf_data.size(0), (- 1), self.num_classes)
        iou_data = iou_data.view(iou_data.size(0), (- 1), 1)
    return {'loc': loc_data, 'conf': conf_data, 'iou': iou_data}