code: def new_complex_like(
      ref: Union[torch.Tensor, ComplexTensor],
      real_imag: Tuple[torch.Tensor, torch.Tensor],
  ):
      if isinstance(ref, ComplexTensor):
          return ComplexTensor(*real_imag)
      elif is_torch_complex_tensor(ref):
          return torch.complex(*real_imag)
      else:
          raise ValueError(
              "Please update your PyTorch version to 1.9+ for complex support."
          )
  
file_path: espnet/espnet2/enh/layers/complex_utils.py
imports: from typing import Sequence, Tuple, Union
  import torch
  from torch_complex import functional
  from torch_complex.tensor import ComplexTensor
label_desc: Use image node_id 1 for calling a global function with example usage: new_complex_like(ref, real_imag) and returns: ComplexTensor, torch