class_docstr: Masked BCE loss.
  
  Args:
      eps (float): Eps to avoid zero-division error.  Defaults to
          1e-6.
class_docstr_tok: ["Masked","BCE","loss",".","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.BCELoss(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 MaskedBCELoss object from inherited base classes: MaskedBCEWithLogitsLoss with example: obj = MaskedBCELoss(eps)