{"record":{"id":"584b4546417205b8","repo":"keras-team/keras","slug":"received-none-value-for-axis","errorCode":null,"errorMessage":"Received `None` value for `axis`","messagePattern":"Received `None` value for `axis`","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/jax/sparse.py","lineNumber":29,"sourceCode":"\n    Args:\n        axis: single int or a tuple of ints for the axis argument. The list of\n          dimensions to reduce or insert.\n        input_shape: the shape of the input as a tuple ints.\n        insert_dims: `False` turns dimensions in `axis` to 1s (use case:\n          reduction along `axis` with `keep_dims=True`). `True`, inserts 1s\n          according to `axis` (use case: `expand_dims`).\n    Returns:\n        A tuple of three lists\n        - The canonical value for `axis`: always a list, negative values have\n          been resolved and values are sorted in ascending order.\n        - The output shape: `input_shape` with 1s at the indices in `axis`, for\n          use as the `shape` argument of `broadcast_in_dim`.\n        - The broadcast dimensions: list of dimensions not in `axis`, for use as\n          the `broadcast_dimensions` argument of `broadcast_in_dim`.\n    \"\"\"\n    if axis is None:\n        raise ValueError(\"Received `None` value for `axis`\")\n    if isinstance(axis, int):\n        axis = (axis,)\n    # Check uniqueness.\n    if len(set(axis)) != len(axis):\n        raise ValueError(f\"Repeated axis in `axis`: {axis}\")\n    result_dims = len(input_shape)\n    if insert_dims:\n        result_dims += len(axis)\n\n    # Resolve negative values.\n    canonical_axis = []\n    for a in axis:\n        if not -result_dims <= a < result_dims:\n            raise ValueError(\n                f\"In `axis`, axis {a} is out of bounds for array \"\n                f\"of dimension {result_dims}\"\n            )\n        if a < 0:","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/jax/sparse.py#L11-L47","documentation":"Error \"Received `None` value for `axis`\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/jax/sparse.py:29 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"}