code: def test_PITSolver_tf_ce_forward(num_spk, flexible_numspk):
      batch = 2
      ncls = 100
      ref = [
          torch.randint(0, ncls, (batch, 10)) for spk in range(num_spk)
      ]
      bias = [F.one_hot(y) for y in ref]
      bias = [F.pad(y, (0, ncls - y.size(-1))) for y in bias]
      inf = [
          torch.rand(batch, 10, ncls) + bias[spk]
          for spk in range(num_spk)
      ]
      solver = PITSolver(
          FrequencyDomainCrossEntropy(),
          independent_perm=True,
          flexible_numspk=flexible_numspk,
      )
  
      loss, stats, others = solver(ref, inf)
      perm = others["perm"]
      correct_perm = list(range(num_spk))
      assert perm[0].equal(torch.tensor(correct_perm)), (
          perm,
          correct_perm,
      )
  
      # test for independent_perm is False
  
      solver = PITSolver(
          FrequencyDomainCrossEntropy(),
          independent_perm=False,
          flexible_numspk=flexible_numspk,
      )
      loss, stats, others = solver(ref, inf, {"perm": perm})
  
imports: import pytest
  import torch
  import torch.nn.functional
  from espnet2.enh.loss.criterions.tf_domain import FrequencyDomainCrossEntropy, FrequencyDomainL1
  from espnet2.enh.loss.wrappers.pit_solver import PITSolver
label_desc: Use image node_id 2 for calling a global function with example usage: test_PITSolver_tf_ce_forward(num_spk, flexible_numspk) without return types