code: def test_neural_beamformer_wpe_output(
      ch, num_spk, multi_source_wpe, use_dnn_mask_for_wpe
  ):
      torch.random.manual_seed(0)
      inputs = torch.randn(2, 16, ch) if ch > 1 else torch.randn(2, 16)
      inputs = inputs.float()
      ilens = torch.LongTensor([16, 12])
      stft = STFTEncoder(
          n_fft=8,
          hop_length=2,
          use_builtin_complex=is_torch_1_12_1_plus,
      )
      model = NeuralBeamformer(
          stft.output_dim,
          num_spk=num_spk,
          use_wpe=True,
          use_dnn_mask_for_wpe=use_dnn_mask_for_wpe,
          multi_source_wpe=multi_source_wpe,
          wlayers=2,
          wunits=2,
          wprojs=2,
          taps=5,
          delay=3,
          use_beamformer=False,
          use_torchaudio_api=is_torch_1_12_1_plus,
      )
      model.eval()
      input_spectrum, flens = stft(inputs, ilens)
      specs, _, others = model(input_spectrum, flens)
      assert isinstance(specs, list)
      if not use_dnn_mask_for_wpe or multi_source_wpe:
          assert len(specs) == 1
      else:
          assert len(specs) == num_spk
      assert specs[0].shape == input_spectrum.shape
      if is_torch_complex_tensor(specs[0]):
          assert specs[0].dtype == torch.complex64
      else:
          assert specs[0].dtype == torch.float
      assert isinstance(others, dict)
      if use_dnn_mask_for_wpe:
          assert "mask_dereverb1" in others, others.keys()
          assert others["mask_dereverb1"].shape == specs[0].shape
  
file_path: espnet/test/espnet2/enh/separator/test_beamformer.py
imports: import numpy
  import pytest
  import torch
  from packaging.version import parse
  from espnet2.enh.encoder.stft_encoder import STFTEncoder
  from espnet2.enh.layers.complex_utils import is_torch_complex_tensor
  from espnet2.enh.layers.dnn_beamformer import BEAMFORMER_TYPES
  from espnet2.enh.separator.neural_beamformer import NeuralBeamformer
label_desc: Use image node_id 2 for calling a global function with example usage: test_neural_beamformer_wpe_output(ch, num_spk, multi_source_wpe, use_dnn_mask_for_wpe) without return types