class_docstr: Masked Smooth L1 loss.
  
  Args:
      beta (float, optional): The threshold in the piecewise function.
          Defaults to 1.
      eps (float, optional): Eps to avoid zero-division error.  Defaults to
          1e-6.
code: def __init__(
      self, beta: Union[float, int] = 1, eps: float = 1e-6
  ) -> None:
      super().__init__()
      if digit_version(torch.__version__) > digit_version("1.6.0"):
          if (
              digit_version(torch.__version__)
              >= digit_version("1.13.0")
              and beta == 0
          ):
              beta = beta + eps
          self.smooth_l1_loss = nn.SmoothL1Loss(
              beta=beta, reduction="none"
          )
      self.eps = eps
      self.beta = beta
  
file_path: mmocr/mmocr/models/common/losses/l1_loss.py
imports: from typing import Optional, Union
  import torch
  import torch.nn
  from mmocr import digit_version
  from mmocr.registry import MODELS
label_desc: Use image node_id 1 to create a new MaskedSmoothL1Loss object from inherited base classes: nn with example: obj = MaskedSmoothL1Loss(beta, eps)