用法
variable_created_in_scope(
v
)
測試在此策略範圍處於活動狀態時是否創建了 v
。
在策略範圍內創建的變量是它的"owned":
strategy = tf.distribute.MirroredStrategy()
with strategy.scope():
v = tf.Variable(1.)
strategy.extended.variable_created_in_scope(v)
True
在策略之外創建的變量不屬於它:
strategy = tf.distribute.MirroredStrategy()
v = tf.Variable(1.)
strategy.extended.variable_created_in_scope(v)
False
相關用法
- Python tf.compat.v1.distribute.StrategyExtended.batch_reduce_to用法及代碼示例
- Python tf.compat.v1.distribute.StrategyExtended.colocate_vars_with用法及代碼示例
- Python tf.compat.v1.distribute.StrategyExtended.non_slot_devices用法及代碼示例
- Python tf.compat.v1.distribute.StrategyExtended.update用法及代碼示例
- Python tf.compat.v1.distribute.StrategyExtended.reduce_to用法及代碼示例
- Python tf.compat.v1.distribute.StrategyExtended.call_for_each_replica用法及代碼示例
- Python tf.compat.v1.distribute.Strategy.run用法及代碼示例
- Python tf.compat.v1.distribute.Strategy.experimental_make_numpy_dataset用法及代碼示例
- Python tf.compat.v1.distribute.Strategy.make_input_fn_iterator用法及代碼示例
- Python tf.compat.v1.distribute.Strategy用法及代碼示例
- Python tf.compat.v1.distribute.Strategy.scope用法及代碼示例
- Python tf.compat.v1.distribute.Strategy.experimental_distribute_dataset用法及代碼示例
- Python tf.compat.v1.distribute.Strategy.reduce用法及代碼示例
- Python tf.compat.v1.distribute.MirroredStrategy.experimental_distribute_dataset用法及代碼示例
- Python tf.compat.v1.distribute.OneDeviceStrategy用法及代碼示例
- Python tf.compat.v1.distribute.MirroredStrategy.experimental_make_numpy_dataset用法及代碼示例
- Python tf.compat.v1.distribute.experimental.TPUStrategy.experimental_distribute_dataset用法及代碼示例
- Python tf.compat.v1.distribute.OneDeviceStrategy.scope用法及代碼示例
- Python tf.compat.v1.distribute.experimental.TPUStrategy.experimental_make_numpy_dataset用法及代碼示例
- Python tf.compat.v1.distribute.OneDeviceStrategy.experimental_distribute_dataset用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.compat.v1.distribute.StrategyExtended.variable_created_in_scope。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。