docstr: Time-domain L1 loss forward.
  
  Args:
      ref: (Batch, T) or (Batch, T, C)
      inf: (Batch, T) or (Batch, T, C)
  Returns:
      loss: (Batch,)
docstr_tok: ["Time-domain","L1","loss","forward",".","Args",":","ref",":","(","Batch",",","T",")","or","(","Batch",",","T",",","C",")","inf",":","(","Batch",",","T",")","or","(","Batch",",","T",",","C",")","Returns",":","loss",":","(","Batch",",",")"]
code: def forward(self, ref, inf) -> torch.Tensor:
      """Time-domain L1 loss forward.
  
      Args:
          ref: (Batch, T) or (Batch, T, C)
          inf: (Batch, T) or (Batch, T, C)
      Returns:
          loss: (Batch,)
      """
      assert ref.shape == inf.shape, (ref.shape, inf.shape)
  
      l1loss = abs(ref - inf)
      if ref.dim() == 3:
          l1loss = l1loss.mean(dim=[1, 2])
      elif ref.dim() == 2:
          l1loss = l1loss.mean(dim=1)
      else:
          raise ValueError(
              "Invalid input shape: ref={}, inf={}".format(
                  ref.shape, inf.shape
              )
          )
      return l1loss
  
imports: import logging
  import math
  from abc import ABC
  import ci_sdr
  import fast_bss_eval
  import torch
  from packaging.version import parse
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.loss.criterions.abs_loss import AbsEnhLoss
  from espnet2.layers.stft import Stft
label_desc: Use image node_id 2 for calling the TimeDomainL1 obj's underlying member method code with example usage: obj.forward(ref, inf) and returns: l1loss