{"record":{"id":"d642cf1a7774d98a","repo":"keras-team/keras","slug":"wrong-number-of-positional-arguments-expected-le","errorCode":null,"errorMessage":"wrong number of positional arguments: expected {len(input_core_dims)}, got {len(args)}","messagePattern":"wrong number of positional arguments: expected (.+?), got (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/common/backend_utils.py","lineNumber":520,"sourceCode":"    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,\n):\n    from keras.src import ops\n\n    if len(args) != len(input_core_dims):\n        raise TypeError(\n            \"wrong number of positional arguments: \"\n            f\"expected {len(input_core_dims)}, got {len(args)}\"\n        )\n    shapes = []\n    dim_sizes = {}\n    for arg, core_dims in zip(args, input_core_dims):\n        _vectorize_update_dim_sizes(\n            dim_sizes, arg.shape, core_dims, is_input=True\n        )\n        ndim = arg.ndim - len(core_dims)\n        shapes.append(arg.shape[:ndim])\n    broadcast_shape = shapes[0]\n    for s in shapes:\n        broadcast_shape = ops.broadcast_shapes(broadcast_shape, s)\n    return broadcast_shape, dim_sizes\n\n\ndef _vectorize_check_output_dims(","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/common/backend_utils.py#L502-L538","documentation":"Guard in _vectorize_parse_input_dimensions: the number of positional arguments supplied at call time does not equal the number of argument groups declared in the gufunc signature, so arguments cannot be paired with their core dimensions.","triggerScenarios":"Thrown at keras/src/backend/common/backend_utils.py:520 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call the vectorized function with exactly one positional argument per signature input group.","Pass constants via keyword or the excluded parameter instead of as extra positional args.","Simplify the signature, e.g. '()->()' repeated, to match the actual call pattern."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}