Skip to content
Snippets Groups Projects
Commit 8f1b8d37 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Add a mirrored strategy

parent 91613d6f
No related branches found
No related tags found
No related merge requests found
Pipeline #51953 failed
import tensorflow as tf
def strategy_fn():
print("Creating MirroredStrategy strategy.")
strategy = tf.distribute.MirroredStrategy()
print("MirroredStrategy strategy created.")
print("Number of devices: {}".format(strategy.num_replicas_in_sync))
return strategy
...@@ -57,6 +57,7 @@ setup( ...@@ -57,6 +57,7 @@ setup(
# entry points for bob keras fit --strategy-fn option # entry points for bob keras fit --strategy-fn option
"bob.learn.tensorflow.strategy": [ "bob.learn.tensorflow.strategy": [
"multi-worker-mirrored-strategy = bob.learn.tensorflow.configs.MultiWorkerMirroredStrategy:strategy_fn", "multi-worker-mirrored-strategy = bob.learn.tensorflow.configs.MultiWorkerMirroredStrategy:strategy_fn",
"mirrored-strategy = bob.learn.tensorflow.configs.MirroredStrategy:strategy_fn",
], ],
}, },
# Classifiers are important if you plan to distribute this package through # Classifiers are important if you plan to distribute this package through
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment