Skip to content
GitLab
菜单
项目
群组
代码片段
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录/注册
切换导航
菜单
打开侧边栏
KMSCAKKSCFKA AKFACAMADCAS
tensorflow-federated
提交
99036cc9
提交
99036cc9
编辑于
12月 03, 2020
作者:
Keith Rush
提交者:
tensorflow-copybara
12月 03, 2020
浏览文件
Adds failing test for progress on partially available workers.
PiperOrigin-RevId: 345482667
上级
147a6c60
变更
1
Hide whitespace changes
Inline
Side-by-side
tensorflow_federated/python/tests/remote_runtime_integration_test.py
浏览文件 @
99036cc9
...
...
@@ -83,6 +83,44 @@ class WorkerFailureTest(parameterized.TestCase):
result
=
map_add_one
([
0
,
1
])
self
.
assertEqual
(
result
,
[
1
,
2
])
@
parameterized
.
named_parameters
(
(
'native_remote_request_reply'
,
remote_runtime_test_utils
.
create_localhost_remote_context
(
_WORKER_PORTS
),
remote_runtime_test_utils
.
create_localhost_worker_contexts
(
[
_WORKER_PORTS
[
0
]]),
),
(
'native_remote_streaming'
,
remote_runtime_test_utils
.
create_localhost_remote_context
(
_WORKER_PORTS
,
rpc_mode
=
'STREAMING'
),
remote_runtime_test_utils
.
create_localhost_worker_contexts
(
[
_WORKER_PORTS
[
0
]]),
),
)
def
test_computations_run_with_partially_available_workers
(
self
,
tff_context
,
server_contexts
):
self
.
skipTest
(
'b/174679820'
)
@
tff
.
tf_computation
(
tf
.
int32
)
def
add_one
(
x
):
return
x
+
1
@
tff
.
federated_computation
(
tff
.
type_at_clients
(
tf
.
int32
))
def
map_add_one
(
federated_arg
):
return
tff
.
federated_map
(
add_one
,
federated_arg
)
context_stack
=
tff
.
framework
.
get_context_stack
()
with
context_stack
.
install
(
tff_context
):
with
contextlib
.
ExitStack
()
as
stack
:
for
server_context
in
server_contexts
:
stack
.
enter_context
(
server_context
)
result
=
map_add_one
([
0
,
1
])
self
.
assertEqual
(
result
,
[
1
,
2
])
# TODO(b/172025644): Promote streaming plus intermediate aggregation to a
# proper backend test when the final cleanup issues are diagnosed and fixed.
...
...
编辑
预览
Supports
Markdown
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录