{"record":{"id":"d0d62fa320f06736","repo":"keras-team/keras","slug":"input-dtypes-tuple-str-n-for-n-in-nodes-have-n","errorCode":null,"errorMessage":"Input dtypes {tuple(str(n) for n in nodes)} have no available implicit dtype promotion path. Try explicitly casting inputs to the desired output type.","messagePattern":"Input dtypes (.+?) have no available implicit dtype promotion path\\. Try explicitly casting inputs to the desired output type\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/common/dtypes.py","lineNumber":164,"sourceCode":"    UB = LATTICE_UPPER_BOUNDS\n    try:\n        bounds = [UB[n] for n in N]\n    except KeyError:\n        dtype = next(n for n in N if n not in UB)\n        raise ValueError(\n            f\"{dtype=} is not a valid dtype for Keras type promotion.\"\n        )\n    CUB = set.intersection(*bounds)\n    LUB = (CUB & N) or {c for c in CUB if CUB.issubset(UB[c])}\n    if len(LUB) == 1:\n        return LUB.pop()\n    elif len(LUB) == 0:\n        msg = (\n            f\"Input dtypes {tuple(str(n) for n in nodes)} have no available \"\n            \"implicit dtype promotion path. Try explicitly casting inputs to \"\n            \"the desired output type.\"\n        )\n        raise ValueError(msg)\n    else:\n        # If we get here, it means the lattice is ill-formed.\n        raise ValueError(\n            f\"Internal Type Promotion error: {nodes} do not have a unique \"\n            f\"least upper bound on the specified lattice; options are {LUB}. \"\n            \"This is an unexpected error in Keras's internal logic; \"\n            \"please report it to the maintainers.\"\n        )\n\n\ndef _dtype_and_weaktype(value):\n    \"\"\"Return a (dtype, weak_type) tuple for the given input.\"\"\"\n    is_weak_type = False\n    if value is int or value is float:\n        # Note that we can't use `value in [int, float]` because the dtype\n        # might be equal to python scalar types.\n        # e.g, tf.float32 == float is True\n        is_weak_type = True","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/common/dtypes.py#L146-L182","documentation":"Error \"Input dtypes {tuple(str(n) for n in nodes)} have no available implicit dtype promotion path. Try explicitly casting inputs to the desired output type.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/common/dtypes.py:164 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"}