keras-team/keras · error · ValueError

Unsupported reduction: {reduction}

Error message

Unsupported reduction: {reduction}

What it means

Error "Unsupported reduction: {reduction}" thrown in keras-team/keras.

Source

Thrown at keras/src/backend/numpy/ops/core.py:355

    return zeros


def scatter_update(inputs, indices, updates, reduction=None):
    indices = np.array(indices)
    indices = np.transpose(indices)
    idx = tuple(indices)
    if reduction is None:
        inputs[idx] = updates
    elif reduction == "add":
        np.add.at(inputs, idx, updates)
    elif reduction == "max":
        np.maximum.at(inputs, idx, updates)
    elif reduction == "min":
        np.minimum.at(inputs, idx, updates)
    elif reduction == "mul":
        np.multiply.at(inputs, idx, updates)
    else:
        raise ValueError(f"Unsupported reduction: {reduction}")
    return inputs


def slice(inputs, start_indices, shape):
    # Validate inputs
    if len(start_indices) != len(shape):
        raise ValueError(
            "Length of `start_indices` must match length of `shape`. "
            f"Received: start_indices={start_indices}, shape={shape}"
        )

    # Generate list of indices arrays for each dimension
    indices = [
        np.arange(start, start + length)
        for start, length in zip(start_indices, shape)
    ]

    # Use np.ix_ to create a multidimensional index array

View on GitHub (pinned to 7a34a03db6)

When it happens

Trigger: Thrown at keras/src/backend/numpy/ops/core.py:355 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of keras-team/keras@7a34a03db6 (2026-08-25). Data as JSON: /api/errors/c7157e6f414515fa. Report an issue: GitHub.