#[2,23]
     cls_target = torch.stack(
            [
                F.pad(x, (0, max_dn_gt - x.shape[0]), value=-1)
                for x in cls_target
            ] #cls_target[0]23    cls_target[1]20   max_dn_gt23

         #[b,23,10]
        box_target = torch.stack(
            [F.pad(x, (0, 0, 0, max_dn_gt - x.shape[0])) for x in box_target]
        ) #[b,23,10]   box_target[0] [23,10]   box_target[1] [20,10]
Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐