Return status of soft device placement flag.
tf.config.get_soft_device_placement()
If enabled, ops can be placed on different devices than the device explicitly assigned by the user. This potentially has a large performance cost due to an increase in data communication between devices.
Some cases where soft_device_placement would modify device assignment are:
For TPUs, if this option is true, a feature called automatic outside compilation is enabled. Automatic outside compilation will move uncompilable ops within a TPU program to instead run on the host. This can be used when encountering compilation failures due to unsupported ops.
| Returns | |
|---|---|
| A boolean indicating if soft placement is enabled. |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/config/get_soft_device_placement