class_docstr: This loss combines a Sigmoid layers and a masked BCE loss in one single
  class. It's AMP-eligible.
  
  Args:
      eps (float): Eps to avoid zero-division error.  Defaults to
          1e-6.
class_docstr_tok: ["This","loss","combines","a","Sigmoid","layers","and","a","masked","BCE","loss","in","one","single","class",".","It","'s","AMP-eligible",".","Args",":","eps","(","float",")",":","Eps","to","avoid","zero-division","error",".","Defaults","to","1e-6","."]
code: def __init__(self, eps: float = 1e-6) -> None:
      super().__init__()
      assert isinstance(eps, float)
      self.eps = eps
      self.loss = nn.BCEWithLogitsLoss(reduction="none")
  
file_path: mmocr/mmocr/models/common/losses/bce_loss.py
imports: from typing import Optional, Union
  import torch
  import torch.nn
  from mmocr.registry import MODELS
label_desc: Use image node_id 1 to create a new MaskedBCEWithLogitsLoss object from inherited base classes: nn with example: obj = MaskedBCEWithLogitsLoss(eps)