Skip to content
GitLab
菜单
项目
群组
代码片段
/
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录/注册
切换导航
菜单
打开侧边栏
KMSCAKKSCFKA AKFACAMADCAS
tensorflow-federated
提交
79df23b0
提交
79df23b0
编辑于
12月 01, 2020
作者:
Keith Rush
提交者:
tensorflow-copybara
12月 01, 2020
浏览文件
Adds failing test for TF graph comparison with NaNs.
PiperOrigin-RevId: 345113267
上级
2438f7bc
变更
1
Show whitespace changes
Inline
Side-by-side
tensorflow_federated/python/core/impl/compiler/tree_analysis_test.py
浏览文件 @
79df23b0
...
...
@@ -280,6 +280,15 @@ def _create_two_variable_tensorflow():
return
_pack_noarg_graph
(
g
.
as_graph_def
(),
result_type
,
result_binding
)
def
_create_tensorflow_graph_with_nan
():
with
tf
.
Graph
().
as_default
()
as
g
:
a
=
tf
.
constant
(
float
(
'NaN'
))
result_type
,
result_binding
=
tensorflow_utils
.
capture_result_from_graph
(
a
,
g
)
return
_pack_noarg_graph
(
g
.
as_graph_def
(),
result_type
,
result_binding
)
class
CountTensorFlowVariablesTest
(
absltest
.
TestCase
):
def
test_raises_on_none
(
self
):
...
...
@@ -362,7 +371,7 @@ class ContainsNoUnboundReferencesTest(absltest.TestCase):
self
.
assertFalse
(
tree_analysis
.
contains_no_unbound_references
(
fn
))
class
Computation
sEqualTest
(
absltest
.
TestCase
):
class
Tree
sEqualTest
(
absltest
.
TestCase
):
def
test_raises_type_error
(
self
):
data
=
building_blocks
.
Data
(
'data'
,
tf
.
int32
)
...
...
@@ -700,6 +709,12 @@ class ComputationsEqualTest(absltest.TestCase):
tuple_2
=
building_blocks
.
Struct
([
data_2
,
data_2
])
self
.
assertTrue
(
tree_analysis
.
trees_equal
(
tuple_1
,
tuple_2
))
def
test_returns_true_for_identical_graphs_with_nans
(
self
):
self
.
skipTest
(
'b/174605105'
)
tf_comp1
=
_create_tensorflow_graph_with_nan
()
tf_comp2
=
_create_tensorflow_graph_with_nan
()
self
.
assertTrue
(
tree_analysis
.
trees_equal
(
tf_comp1
,
tf_comp2
))
@
computations
.
federated_computation
def
non_aggregation_intrinsics
():
...
...
编辑
预览
支持
Markdown
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录