{"record":{"id":"f999bed01261d41b","repo":"keras-team/keras","slug":"output-shape-shape-does-not-match-core-dimension","errorCode":null,"errorMessage":"output shape {shape} does not match core dimensions {core_dims}","messagePattern":"output shape (.+?) does not match core dimensions (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/common/backend_utils.py","lineNumber":497,"sourceCode":"            for arg in re.findall(_ARGUMENT, arg_list)\n        ]\n        for arg_list in signature.split(\"->\")\n    )\n    return args, retvals\n\n\ndef _vectorize_update_dim_sizes(dim_sizes, shape, core_dims, is_input=True):\n    num_core_dims = len(core_dims)\n    if is_input:\n        if len(shape) < num_core_dims:\n            raise ValueError(\n                f\"input with shape {shape} does not \"\n                \"have enough dimensions for all core \"\n                f\"dimensions {core_dims}\"\n            )\n    else:\n        if len(shape) != num_core_dims:\n            raise ValueError(\n                f\"output shape {shape} does not \"\n                f\"match core dimensions {core_dims}\"\n            )\n\n    core_shape = shape[-num_core_dims:] if core_dims else ()\n    for dim, size in zip(core_dims, core_shape):\n        if dim not in dim_sizes:\n            dim_sizes[dim] = size\n        elif size != dim_sizes[dim]:\n            raise ValueError(\n                f\"inconsistent size for core dimension {dim}: \"\n                f\"{size} vs {dim_sizes[dim]}\"\n            )\n\n\ndef _vectorize_parse_input_dimensions(\n    args,\n    input_core_dims,","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/common/backend_utils.py#L479-L515","documentation":"Error \"output shape {shape} does not match core dimensions {core_dims}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/common/backend_utils.py:497 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"}