Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.tensorflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.learn.tensorflow
Commits
8f1b8d37
Commit
8f1b8d37
authored
3 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Add a mirrored strategy
parent
91613d6f
No related branches found
No related tags found
No related merge requests found
Pipeline
#51953
failed
3 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/learn/tensorflow/configs/MirroredStrategy.py
+9
-0
9 additions, 0 deletions
bob/learn/tensorflow/configs/MirroredStrategy.py
setup.py
+1
-0
1 addition, 0 deletions
setup.py
with
10 additions
and
0 deletions
bob/learn/tensorflow/configs/MirroredStrategy.py
0 → 100644
+
9
−
0
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
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
0
View file @
8f1b8d37
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment