tf.config.set_soft_device_placement
Stay organized with collections
Save and categorize content based on your preferences.
Set if soft device placement is enabled.
tf.config.set_soft_device_placement(
enabled
)
If enabled, an op will be placed on CPU if any of the following are true
- there's no GPU implementation for the OP
- no GPU devices are known or registered
- need to co-locate with reftype input(s) which are from CPU
Args |
enabled
|
Whether to enable soft placement.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2021-08-16 UTC.
[null,null,["Last updated 2021-08-16 UTC."],[],[],null,["# tf.config.set_soft_device_placement\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/config/set_soft_device_placement) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.6.0/tensorflow/python/framework/config.py#L261-L273) |\n\nSet if soft device placement is enabled.\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\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------|-----------------------------------|\n| `enabled` | Whether to enable soft placement. |\n\n\u003cbr /\u003e"]]