# tf.keras.mixed_precision.experimental.set_policy

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/keras/mixed_precision/experimental/set_policy) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/mixed_precision/experimental/policy.py#L396-L421) |

Sets the global Policy.

#### View aliases


**Compat aliases for migration**

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

\`tf.compat.v1.keras.mixed_precision.experimental.set_policy\`, \`tf.compat.v2.keras.mixed_precision.experimental.set_policy\`

<br />

    tf.keras.mixed_precision.experimental.set_policy(
        policy
    )

The global policy is the default policy used for layers, if no policy is
passed to the layer constructor. If no global policy is set, layers will
instead default to a Policy constructed from [`tf.keras.backend.floatx()`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/backend/floatx) in
TensorFlow 2. In TensorFlow 1, layers default to an "infer" policy.

See [`keras.mixed_precision.experimental.Policy`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/mixed_precision/experimental/Policy) for more information.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `policy` | A Policy, or a string that will be converted to a Policy.. |

<br />