def forward(self, input: torch.Tensor, target: torch.Tensor, weights: torch.Tensor):
    '\n        Args:\n            input: (B, #anchors, #classes) float tensor.\n                Predited logits for each class.\n            target: (B, #anchors, #classes) float tensor.\n                One-hot classification targets.\n            weights: (B, #anchors) float tensor.\n                Anchor-wise weights.\n\n        Returns:\n            loss: (B, #anchors) float tensor.\n                Weighted cross entropy loss without reduction\n        '
    input = input.permute(0, 2, 1)
    target = target.argmax(dim=(- 1))
    loss = (F.cross_entropy(input, target, reduction='none') * weights)
    return loss
Args:
    input: (B, #anchors, #classes) float tensor.
        Predited logits for each class.
    target: (B, #anchors, #classes) float tensor.
        One-hot classification targets.
    weights: (B, #anchors) float tensor.
        Anchor-wise weights.

Returns:
    loss: (B, #anchors) float tensor.
        Weighted cross entropy loss without reduction
def forward(self, input: torch.Tensor, target: torch.Tensor, weights: torch.Tensor):
    '\n        Args:\n            input: (B, #anchors, #classes) float tensor.\n                Predited logits for each class.\n            target: (B, #anchors, #classes) float tensor.\n                One-hot classification targets.\n            weights: (B, #anchors) float tensor.\n                Anchor-wise weights.\n\n        Returns:\n            loss: (B, #anchors) float tensor.\n                Weighted cross entropy loss without reduction\n        '
    input = input.permute(0, 2, 1)
    target = target.argmax(dim=(- 1))
    loss = (F.cross_entropy(input, target, reduction='none') * weights)
    return loss