code: def test_tf_ce_criterion_forward(input_ch):
      criterion = FrequencyDomainCrossEntropy()
  
      batch = 2
      ncls = 200
      shape = (
          (batch, 10, ncls)
          if input_ch == 1
          else (batch, 10, input_ch, ncls)
      )
      label_shape = (
          (batch, 10) if input_ch == 1 else (batch, 10, input_ch)
      )
      inf_spec = torch.rand(*shape)
      ref_spec = torch.randint(0, ncls, label_shape)
  
      loss = criterion(ref_spec, inf_spec)
      assert loss.shape == (batch,), (
          "Invlid loss shape with " + criterion.name
      )
  
file_path: espnet/test/espnet2/enh/loss/criterions/test_tf_domain.py
imports: import pytest
  import torch
  from packaging.version import parse
  from torch_complex import ComplexTensor
  from espnet2.enh.loss.criterions.tf_domain import FrequencyDomainAbsCoherence, FrequencyDomainCrossEntropy, FrequencyDomainDPCL, FrequencyDomainL1, FrequencyDomainMSE
label_desc: Use image node_id 4 for calling a global function with example usage: test_tf_ce_criterion_forward(input_ch) without return types