[null,null,["Last updated 2023-03-23 UTC."],[],[],null,["# tf.config.set_soft_device_placement\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.11.1/tensorflow/python/framework/config.py#L262-L277) |\n\nEnable or disable soft device placement.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.config.set_soft_device_placement`](https://www.tensorflow.org/api_docs/python/tf/config/set_soft_device_placement)\n\n\u003cbr /\u003e\n\n tf.config.set_soft_device_placement(\n enabled\n )\n\nIf enabled, an op will be placed on CPU if any of the following are true\n\n1. there's no GPU implementation for the OP\n2. no GPU devices are known or registered\n3. need to co-locate with reftype input(s) which are from CPU\n\n| **Note:** by default soft device placement is enabled when running in eager mode (for convenience) and disabled in graph mode (for performance).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------|--------------------------------------------------------|\n| `enabled` | A boolean indicating whether to enable soft placement. |\n\n\u003cbr /\u003e"]]