# tf.random.truncated_normal

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/random/truncated_normal) | [![](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/random_ops.py#L138-L179) |

Outputs random values from a truncated normal distribution.

#### View aliases


**Main aliases**

\`tf.truncated_normal\`
**Compat aliases for migration**

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

[`tf.compat.v1.random.truncated_normal`](https://www.tensorflow.org/api_docs/python/tf/random/truncated_normal), [`tf.compat.v1.truncated_normal`](https://www.tensorflow.org/api_docs/python/tf/random/truncated_normal), \`tf.compat.v2.random.truncated_normal\`

<br />

    tf.random.truncated_normal(
        shape, mean=0.0, stddev=1.0, dtype=tf.dtypes.float32, seed=None, name=None
    )

The generated values follow a normal distribution with specified mean and
standard deviation, except that values whose magnitude is more than 2 standard
deviations from the mean are dropped and re-picked.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `shape` | A 1-D integer Tensor or Python array. The shape of the output tensor. |
| `mean` | A 0-D Tensor or Python value of type `dtype`. The mean of the truncated normal distribution. |
| `stddev` | A 0-D Tensor or Python value of type `dtype`. The standard deviation of the normal distribution, before truncation. |
| `dtype` | The type of the output. |
| `seed` | A Python integer. Used to create a random seed for the distribution. See [`tf.compat.v1.set_random_seed`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/random/set_random_seed) for behavior. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor of the specified shape filled with random truncated normal values. ||

<br />