# tf.is_variable_initialized

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/variables.py#L3273-L3285) |

Tests if a variable has been initialized.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.is_variable_initialized(
        variable
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `variable` | A `Variable`. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Returns a scalar boolean Tensor, `True` if the variable has been initialized, `False` otherwise. ||

<br />

> [!NOTE]
> **Note:** The output of this function should be used. If it is not, a warning will be logged. To mark the output as used, call its .mark_used() method.