code: def test_dc_crn_separator_forward_backward_complex(
      input_dim,
      num_spk,
      input_channels,
      enc_hid_channels,
      enc_layers,
      glstm_groups,
      glstm_layers,
      glstm_bidirectional,
      glstm_rearrange,
      mode,
  ):
      model = DC_CRNSeparator(
          input_dim=input_dim,
          num_spk=num_spk,
          input_channels=input_channels,
          enc_hid_channels=enc_hid_channels,
          enc_kernel_size=(1, 3),
          enc_padding=(0, 1),
          enc_last_kernel_size=(1, 3),
          enc_last_stride=(1, 2),
          enc_last_padding=(0, 1),
          enc_layers=enc_layers,
          skip_last_kernel_size=(1, 3),
          skip_last_stride=(1, 1),
          skip_last_padding=(0, 1),
          glstm_groups=glstm_groups,
          glstm_layers=glstm_layers,
          glstm_bidirectional=glstm_bidirectional,
          glstm_rearrange=glstm_rearrange,
          mode=mode,
      )
      model.train()
  
      real = torch.rand(2, 10, input_dim)
      imag = torch.rand(2, 10, input_dim)
      x = (
          torch.complex(real, imag)
          if is_torch_1_9_plus
          else ComplexTensor(real, imag)
      )
      x_lens = torch.tensor([10, 8], dtype=torch.long)
  
      masked, flens, others = model(x, ilens=x_lens)
  
      assert is_complex(masked[0])
      assert len(masked) == num_spk
  
      masked[0].abs().mean().backward()
  
file_path: espnet/test/espnet2/enh/separator/test_dc_crn_separator.py
imports: import pytest
  import torch
  from packaging.version import parse
  from torch_complex import ComplexTensor
  from espnet2.enh.layers.complex_utils import is_complex
  from espnet2.enh.separator.dc_crn_separator import DC_CRNSeparator
label_desc: Use image node_id 1 for calling a global function with example usage: test_dc_crn_separator_forward_backward_complex(input_dim, num_spk, input_channels, enc_hid_channels, enc_layers, glstm_groups, glstm_layers, glstm_bidirectional, glstm_rearrange, mode) without return types