{"record":{"id":"e3b6c3cb20e959e0","repo":"keras-team/keras","slug":"input-x-should-be-a-tuple-of-two-tensors-real","errorCode":null,"errorMessage":"Input `x` should be a tuple of two tensors - real and imaginary.Received: x={x}","messagePattern":"Input `x` should be a tuple of two tensors - real and imaginary\\.Received: x=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/jax/math.py","lineNumber":109,"sourceCode":"\n\ndef extract_sequences(x, sequence_length, sequence_stride):\n    *batch_shape, signal_length = x.shape\n    batch_shape = list(batch_shape)\n    x = jnp.reshape(x, (math.prod(batch_shape), signal_length, 1))\n    x = jax.lax.conv_general_dilated_patches(\n        x,\n        (sequence_length,),\n        (sequence_stride,),\n        \"VALID\",\n        dimension_numbers=(\"NTC\", \"OIT\", \"NTC\"),\n    )\n    return jnp.reshape(x, (*batch_shape, *x.shape[-2:]))\n\n\ndef _get_complex_tensor_from_tuple(x):\n    if not isinstance(x, (tuple, list)) or len(x) != 2:\n        raise ValueError(\n            \"Input `x` should be a tuple of two tensors - real and imaginary.\"\n            f\"Received: x={x}\"\n        )\n    # `convert_to_tensor` does not support passing complex tensors. We separate\n    # the input out into real and imaginary and convert them separately.\n    real, imag = x\n    # Check shapes.\n    if real.shape != imag.shape:\n        raise ValueError(\n            \"Input `x` should be a tuple of two tensors - real and imaginary.\"\n            \"Both the real and imaginary parts should have the same shape. \"\n            f\"Received: x[0].shape = {real.shape}, x[1].shape = {imag.shape}\"\n        )\n    # Ensure dtype is float.\n    if not jnp.issubdtype(real.dtype, jnp.floating) or not jnp.issubdtype(\n        imag.dtype, jnp.floating\n    ):\n        raise ValueError(","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/jax/math.py#L91-L127","documentation":"Error \"Input `x` should be a tuple of two tensors - real and imaginary.Received: x={x}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/jax/math.py:109 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}