{"record":{"id":"4078d94c82a73312","repo":"keras-team/keras","slug":"shapes-are-incompatible-for-associative-scan-inter-4078d9","errorCode":null,"errorMessage":"Shapes are incompatible for associative_scan interleaving. a.shape[{axis}]={a.shape[axis]}, b.shape[{axis}]={b.shape[axis]}","messagePattern":"Shapes are incompatible for associative_scan interleaving\\. a\\.shape\\[(.+?)\\]=(.+?), b\\.shape\\[(.+?)\\]=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/numpy/ops/core.py","lineNumber":240,"sourceCode":"        c = f(a, b)\n        c_flat = tree.flatten(c)\n        return c_flat\n\n    num_elems = int(elems_flat[0].shape[axis])\n    if not all(int(elem.shape[axis]) == num_elems for elem in elems_flat[1:]):\n        raise ValueError(\n            \"Array inputs to associative_scan must have the same \"\n            \"first dimension. (saw: {})\".format(\n                [elem.shape for elem in elems_flat]\n            )\n        )\n\n    def _interleave(a, b, axis):\n        \"\"\"Given two Tensors of static shape, interleave them along axis.\"\"\"\n        if not (\n            a.shape[axis] == b.shape[axis] or a.shape[axis] == b.shape[axis] + 1\n        ):\n            raise ValueError(\n                \"Shapes are incompatible for associative_scan interleaving. \"\n                f\"a.shape[{axis}]={a.shape[axis]}, \"\n                f\"b.shape[{axis}]={b.shape[axis]}\"\n            )\n\n        # we want to get a: [a1, a2], b: [b1, b2]\n        # to a: [a1, 0, a2, 0], b: [0, b1, 0, b2]\n        a_shape = list(a.shape)\n        a_shape[axis] = a.shape[axis] * 2 - 1\n\n        b_shape = list(b.shape)\n        b_shape[axis] = b.shape[axis] * 2 - 1\n\n        a_dil = np.zeros(a_shape)\n        np.copyto(slice_along_axis(a_dil, 0, None, 2, axis), a)\n        b_dil = np.zeros(b_shape)\n        np.copyto(slice_along_axis(b_dil, 0, None, 2, axis), b)\n","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/numpy/ops/core.py#L222-L258","documentation":"Error \"Shapes are incompatible for associative_scan interleaving. a.shape[{axis}]={a.shape[axis]}, b.shape[{axis}]={b.shape[axis]}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/numpy/ops/core.py:240 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"}