# tf.keras.backend.count_params

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/backend/count_params) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/keras/backend.py#L1532-L1552) |

Returns the static number of elements in a variable or tensor.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.keras.backend.count_params`](https://www.tensorflow.org/api_docs/python/tf/keras/backend/count_params)

<br />

    tf.keras.backend.count_params(
        x
    )

<br />

<br />

<br />

| ## Arguments ||
|---|---|
| `x` | Variable or tensor. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Integer, the number of scalars in `x`. ||

<br />

#### Example:

    kvar = tf.keras.backend.zeros((2,3))
    tf.keras.backend.count_params(kvar)
    6
    tf.keras.backend.eval(kvar)
    array([[0.,  0.,  0.],
           [0.,  0.,  0.]], dtype=float32)