class_docstr: Focal loss for multi-class problem. It uses softmax to compute focal term instead of sigmoid as in
  original paper. This loss expects target labes to have one dimension less (like in nn.CrossEntropyLoss).
class_docstr_tok: ["Focal","loss","for","multi-class","problem",".","It","uses","softmax","to","compute","focal","term","instead","of","sigmoid","as","in","original","paper",".","This","loss","expects","target","labes","to","have","one","dimension","less","(","like","in","nn.CrossEntropyLoss",")","."]
docstr: Args:
      inputs: [B,C,H,W] tensor
      targets: [B,H,W] tensor
  
  Returns:
docstr_tok: ["Args",":","inputs",":","[","B",",","C",",","H",",","W","]","tensor","targets",":","[","B",",","H",",","W","]","tensor","Returns",":"]
code: def forward(self, inputs: Tensor, targets: Tensor) -> Tensor:
      """
  
      Args:
          inputs: [B,C,H,W] tensor
          targets: [B,H,W] tensor
  
      Returns:
  
      """
      return softmax_focal_loss_with_logits(
          inputs,
          targets,
          gamma=self.gamma,
          reduction=self.reduction,
          normalized=self.normalized,
          reduced_threshold=self.reduced_threshold,
          ignore_index=self.ignore_index,
      )
  
file_path: pytorch-toolbelt/pytorch_toolbelt/losses/focal.py
imports: from functools import partial
  from typing import Optional
  import torch
  from torch import Tensor, nn
  from torch.nn.modules.loss import _Loss
  from .functional import focal_loss_with_logits, softmax_focal_loss_with_logits
  from pytorch_toolbelt.utils import pytorch_toolbelt_deprecated
label_desc: Use image node_id 2 for calling the CrossEntropyFocalLoss obj's underlying member method code with example usage: obj.forward(inputs, targets) and returns: softmax_focal_loss_with_logits