class_docstr: Base class for text detection module loss.
      
docstr: Calculates losses from a batch of inputs and data samples. Returns a
  dict of losses.
  
  Args:
      inputs (Tensor or list[Tensor] or dict): The raw tensor outputs
          from the model.
      data_samples (list(TextDetDataSample)): Datasamples containing
          ground truth data.
  
  Returns:
      dict: A dict of losses.
docstr_tok: ["Calculates","losses","from","a","batch","of","inputs","and","data","samples",".","Returns","a","dict","of","losses",".","Args",":","inputs","(","Tensor","or","list","[","Tensor","]","or","dict",")",":","The","raw","tensor","outputs","from","the","model",".","data_samples","(","list","(","TextDetDataSample",")",")",":","Datasamples","containing","ground","truth","data",".","Returns",":","dict",":","A","dict","of","losses","."]
code: def forward(
      self, inputs: INPUT_TYPES, data_samples: DetSampleList = None
  ) -> Dict:
      """Calculates losses from a batch of inputs and data samples. Returns a
      dict of losses.
  
      Args:
          inputs (Tensor or list[Tensor] or dict): The raw tensor outputs
              from the model.
          data_samples (list(TextDetDataSample)): Datasamples containing
              ground truth data.
  
      Returns:
          dict: A dict of losses.
      """
      pass
  
file_path: mmocr/mmocr/models/textdet/module_losses/base.py
imports: from abc import ABCMeta, abstractmethod
  from typing import Dict, Sequence, Tuple, Union
  import torch
  from torch import nn
  from mmocr.registry import MODELS
  from mmocr.utils.typing_utils import DetSampleList
label_desc: Use image node_id 2 for calling the BaseTextDetModuleLoss obj's underlying member method code with example usage: obj.forward(inputs, data_samples) without return types