<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/numpy.py#L317-L351) |

Test whether all array elements along a given axis evaluate to `True`.

#### View aliases


**Main aliases**

[`tf.keras.ops.numpy.all`](https://www.tensorflow.org/api_docs/python/tf/keras/ops/all)

<br />

    tf.keras.ops.all(
        x, axis=None, keepdims=False
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |
| `axis` | An integer or tuple of integers that represent the axis along which a logical AND reduction is performed. The default (`axis=None`) is to perform a logical AND over all the dimensions of the input array. `axis` may be negative, in which case it counts for the last to the first axis. |
| `keepdims` | If `True`, axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array. Defaults to `False`. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The tensor containing the logical AND reduction over the `axis`. ||

<br />

#### Examples:

    x = keras.ops.convert_to_tensor([True, False])
    keras.ops.all(x)
    array(False, shape=(), dtype=bool)

    x = keras.ops.convert_to_tensor([[True, False], [True, True]])
    keras.ops.all(x, axis=0)
    array([ True False], shape=(2,), dtype=bool)

`keepdims=True` outputs a tensor with dimensions reduced to one.

    >>> x = keras.ops.convert_to_tensor([[True, False], [True, True]])
    >>> keras.ops.all(x, keepdims=True)
    array([[False]], shape=(1, 1), dtype=bool)