Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
b2522f9b
Commit
b2522f9b
authored
Nov 20, 2018
by
josh11b
Committed by
Taylor Robie
Nov 20, 2018
Browse files
worker_devices moving to ds.extended (#5775)
parent
9a4848a2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
official/utils/misc/distribution_utils_test.py
official/utils/misc/distribution_utils_test.py
+6
-6
No files found.
official/utils/misc/distribution_utils_test.py
View file @
b2522f9b
...
@@ -28,20 +28,20 @@ class GetDistributionStrategyTest(tf.test.TestCase):
...
@@ -28,20 +28,20 @@ class GetDistributionStrategyTest(tf.test.TestCase):
def
test_one_device_strategy_cpu
(
self
):
def
test_one_device_strategy_cpu
(
self
):
ds
=
distribution_utils
.
get_distribution_strategy
(
0
)
ds
=
distribution_utils
.
get_distribution_strategy
(
0
)
self
.
assertEquals
(
ds
.
num_replicas_in_sync
,
1
)
self
.
assertEquals
(
ds
.
num_replicas_in_sync
,
1
)
self
.
assertEquals
(
len
(
ds
.
worker_devices
),
1
)
self
.
assertEquals
(
len
(
ds
.
extended
.
worker_devices
),
1
)
self
.
assertIn
(
'CPU'
,
ds
.
worker_devices
[
0
])
self
.
assertIn
(
'CPU'
,
ds
.
extended
.
worker_devices
[
0
])
def
test_one_device_strategy_gpu
(
self
):
def
test_one_device_strategy_gpu
(
self
):
ds
=
distribution_utils
.
get_distribution_strategy
(
1
)
ds
=
distribution_utils
.
get_distribution_strategy
(
1
)
self
.
assertEquals
(
ds
.
num_replicas_in_sync
,
1
)
self
.
assertEquals
(
ds
.
num_replicas_in_sync
,
1
)
self
.
assertEquals
(
len
(
ds
.
worker_devices
),
1
)
self
.
assertEquals
(
len
(
ds
.
extended
.
worker_devices
),
1
)
self
.
assertIn
(
'GPU'
,
ds
.
worker_devices
[
0
])
self
.
assertIn
(
'GPU'
,
ds
.
extended
.
worker_devices
[
0
])
def
test_mirrored_strategy
(
self
):
def
test_mirrored_strategy
(
self
):
ds
=
distribution_utils
.
get_distribution_strategy
(
5
)
ds
=
distribution_utils
.
get_distribution_strategy
(
5
)
self
.
assertEquals
(
ds
.
num_replicas_in_sync
,
5
)
self
.
assertEquals
(
ds
.
num_replicas_in_sync
,
5
)
self
.
assertEquals
(
len
(
ds
.
worker_devices
),
5
)
self
.
assertEquals
(
len
(
ds
.
extended
.
worker_devices
),
5
)
for
device
in
ds
.
worker_devices
:
for
device
in
ds
.
extended
.
worker_devices
:
self
.
assertIn
(
'GPU'
,
device
)
self
.
assertIn
(
'GPU'
,
device
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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