code: def _get_complex_tensor_from_tuple(x):
      if not isinstance(x, (tuple, list)) or len(x) != 2:
          raise ValueError(
              "Input `x` should be a tuple of two tensors - real and imaginary."
              f"Received: x={x}"
          )
      # `convert_to_tensor` does not support passing complex tensors. We separate
      # the input out into real and imaginary and convert them separately.
      real, imag = x
      real = convert_to_tensor(real)
      imag = convert_to_tensor(imag)
      # Check shape.
      if real.shape != imag.shape:
          raise ValueError(
              "Input `x` should be a tuple of two tensors - real and imaginary."
              "Both the real and imaginary parts should have the same shape. "
              f"Received: x[0].shape = {real.shape}, x[1].shape = {imag.shape}"
          )
      # Ensure dtype is float.
      if not torch.is_floating_point(
          real
      ) or not torch.is_floating_point(imag):
          raise ValueError(
              "At least one tensor in input `x` is not of type float."
              f"Received: x={x}."
          )
  
      complex_input = torch.complex(real, imag)
      return complex_input
  
imports: import math
  import torch
  from keras.backend import standardize_dtype
  from keras.backend.torch.core import convert_to_tensor
  from keras.backend.torch.core import get_device
  from keras.backend.torch.numpy import pad
label_desc: Use image node_id 9 for calling a global function with example usage: _get_complex_tensor_from_tuple(x) and returns: complex_input