code: def test_transformer_separator_forward_backward_complex(
      input_dim,
      adim,
      layers,
      aheads,
      linear_units,
      num_spk,
      nonlinear,
      positionwise_layer_type,
      normalize_before,
      concat_after,
      dropout_rate,
      positional_dropout_rate,
      attention_dropout_rate,
      use_scaled_pos_enc,
  ):
      model = TransformerSeparator(
          input_dim=input_dim,
          num_spk=num_spk,
          adim=adim,
          aheads=aheads,
          layers=layers,
          linear_units=linear_units,
          positionwise_layer_type=positionwise_layer_type,
          normalize_before=normalize_before,
          concat_after=concat_after,
          dropout_rate=dropout_rate,
          positional_dropout_rate=positional_dropout_rate,
          attention_dropout_rate=attention_dropout_rate,
          use_scaled_pos_enc=use_scaled_pos_enc,
          nonlinear=nonlinear,
      )
      model.train()
  
      real = torch.rand(2, 10, input_dim)
      imag = torch.rand(2, 10, input_dim)
      x = ComplexTensor(real, imag)
      x_lens = torch.tensor([10, 8], dtype=torch.long)
  
      masked, flens, others = model(x, ilens=x_lens)
  
      assert isinstance(masked[0], ComplexTensor)
      assert len(masked) == num_spk
  
      masked[0].abs().mean().backward()
  
file_path: espnet/test/espnet2/enh/separator/test_transformer_separator.py
imports: import pytest
  import torch
  from torch import Tensor
  from torch_complex import ComplexTensor
  from espnet2.enh.separator.transformer_separator import TransformerSeparator
label_desc: Use image node_id 1 for calling a global function with example usage: test_transformer_separator_forward_backward_complex(input_dim, adim, layers, aheads, linear_units, num_spk, nonlinear, positionwise_layer_type, normalize_before, concat_after, dropout_rate, positional_dropout_rate, attention_dropout_rate, use_scaled_pos_enc) without return types