# tf.config.set_soft_device_placement

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/config/set_soft_device_placement) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.1.0/tensorflow/python/framework/config.py#L175-L187) |

Set if soft device placement is enabled.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.config.set_soft_device_placement(
        enabled
    )

If enabled, an op will be placed on CPU if any of the following are true

1. there's no GPU implementation for the OP
2. no GPU devices are known or registered
3. need to co-locate with reftype input(s) which are from CPU

<br />

<br />

<br />

| ## Args ||
|---|---|
| `enabled` | Whether to enable soft placement. |

<br />