Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.tensorflow
Commits
8f1b8d37
Commit
8f1b8d37
authored
Jun 30, 2021
by
Amir MOHAMMADI
Browse files
Add a mirrored strategy
parent
91613d6f
Pipeline
#51953
failed with stage
in 4 minutes and 29 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/learn/tensorflow/configs/MirroredStrategy.py
0 → 100644
View file @
8f1b8d37
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
setup.py
View file @
8f1b8d37
...
...
@@ -57,6 +57,7 @@ setup(
# entry points for bob keras fit --strategy-fn option
"bob.learn.tensorflow.strategy"
:
[
"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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment