如果當前存在非默認 tf.distribute.Strategy
,則返回。
用法
tf.distribute.has_strategy()
返回
-
如果在
with strategy.scope():
內,則為真。
assert not tf.distribute.has_strategy()
with strategy.scope():
assert tf.distribute.has_strategy()
相關用法
- Python tf.distribute.OneDeviceStrategy.experimental_distribute_values_from_function用法及代碼示例
- Python tf.distribute.TPUStrategy用法及代碼示例
- Python tf.distribute.experimental_set_strategy用法及代碼示例
- Python tf.distribute.experimental.MultiWorkerMirroredStrategy.gather用法及代碼示例
- Python tf.distribute.cluster_resolver.TFConfigClusterResolver用法及代碼示例
- Python tf.distribute.experimental.MultiWorkerMirroredStrategy用法及代碼示例
- Python tf.distribute.TPUStrategy.experimental_assign_to_logical_device用法及代碼示例
- Python tf.distribute.NcclAllReduce用法及代碼示例
- Python tf.distribute.OneDeviceStrategy.experimental_distribute_dataset用法及代碼示例
- Python tf.distribute.experimental.rpc.Server.create用法及代碼示例
- Python tf.distribute.experimental.MultiWorkerMirroredStrategy.experimental_distribute_dataset用法及代碼示例
- Python tf.distribute.OneDeviceStrategy.gather用法及代碼示例
- Python tf.distribute.MirroredStrategy.reduce用法及代碼示例
- Python tf.distribute.Strategy.scope用法及代碼示例
- Python tf.distribute.TPUStrategy.reduce用法及代碼示例
- Python tf.distribute.experimental.partitioners.Partitioner.__call__用法及代碼示例
- Python tf.distribute.DistributedIterator.get_next用法及代碼示例
- Python tf.distribute.Strategy.experimental_distribute_values_from_function用法及代碼示例
- Python tf.distribute.get_strategy用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.distribute.has_strategy。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。