torch.where

📅 2026/7/21 23:18:00 👁️ 阅读次数 📝 编程学习
torch.where

box_target = torch.where(
cls_target[..., None] == -1, box_target.new_tensor(0), box_target
)

cls_target[b,23] cls_target[..., None] [b,23,1]
box_target[b,23,10]