Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update dtype assert
  • Loading branch information
wangjiangben-hw authored Sep 30, 2022
commit 5841f92cfe786f82292ac3cb1254e24d70186a08
3 changes: 1 addition & 2 deletions mmcv/ops/focal_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ def forward(ctx,
weight: Optional[torch.Tensor] = None,
reduction='mean') -> torch.Tensor:

assert isinstance(
target, (torch.Tensor, torch.LongTensor, torch.cuda.LongTensor))
assert target.dtype == torch.long
assert input.dim() == 2
assert target.dim() == 1
assert input.size(0) == target.size(0)
Expand Down