Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_38905368
tensorflow
提交
49684837
T
tensorflow
项目概览
qq_38905368
/
tensorflow
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tensorflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
49684837
编写于
11月 01, 2016
作者:
G
Gunhan Gulsoy
提交者:
TensorFlower Gardener
11月 01, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix race conditions in tests due to using same folders for saver.
Change: 137881303
上级
ce92434f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
6 deletion
+20
-6
tensorflow/contrib/layers/python/layers/feature_column_test.py
...rflow/contrib/layers/python/layers/feature_column_test.py
+9
-2
tensorflow/contrib/lookup/lookup_ops_test.py
tensorflow/contrib/lookup/lookup_ops_test.py
+7
-3
tensorflow/contrib/opt/python/training/moving_average_optimizer_test.py
...trib/opt/python/training/moving_average_optimizer_test.py
+4
-1
未找到文件。
tensorflow/contrib/layers/python/layers/feature_column_test.py
浏览文件 @
49684837
...
...
@@ -21,6 +21,7 @@ from __future__ import print_function
import
itertools
import
os
import
tempfile
import
numpy
as
np
import
tensorflow
as
tf
...
...
@@ -609,7 +610,10 @@ class FeatureColumnTest(tf.test.TestCase):
{
embedding_col
:
input_tensor
},
[
embedding_col
])
save
=
tf
.
train
.
Saver
()
checkpoint_path
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
"model.ckpt"
)
ckpt_dir_prefix
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
"init_embedding_col_w_from_ckpt"
)
ckpt_dir
=
tempfile
.
mkdtemp
(
prefix
=
ckpt_dir_prefix
)
checkpoint_path
=
os
.
path
.
join
(
ckpt_dir
,
"model.ckpt"
)
with
self
.
test_session
()
as
sess
:
sess
.
run
(
tf
.
initialize_all_variables
())
...
...
@@ -670,7 +674,10 @@ class FeatureColumnTest(tf.test.TestCase):
assign_op
=
tf
.
assign
(
weight
[
0
],
weight
[
0
]
+
0.5
)
save
=
tf
.
train
.
Saver
()
checkpoint_path
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
"model.ckpt"
)
ckpt_dir_prefix
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
"init_crossed_col_w_from_ckpt"
)
ckpt_dir
=
tempfile
.
mkdtemp
(
prefix
=
ckpt_dir_prefix
)
checkpoint_path
=
os
.
path
.
join
(
ckpt_dir
,
"model.ckpt"
)
with
self
.
test_session
()
as
sess
:
sess
.
run
(
tf
.
initialize_all_variables
())
...
...
tensorflow/contrib/lookup/lookup_ops_test.py
浏览文件 @
49684837
...
...
@@ -18,6 +18,7 @@ from __future__ import division
from
__future__
import
print_function
import
os
import
tempfile
import
numpy
as
np
import
six
import
tensorflow
as
tf
...
...
@@ -296,7 +297,8 @@ class MutableHashTableOpTest(tf.test.TestCase):
self
.
assertAllEqual
([
0
,
1
,
2
],
sorted_values
)
def
testSaveRestore
(
self
):
save_path
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
"hash"
)
save_dir
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
"save_restore"
)
save_path
=
os
.
path
.
join
(
tempfile
.
mkdtemp
(
prefix
=
save_dir
),
"hash"
)
with
self
.
test_session
(
graph
=
tf
.
Graph
())
as
sess
:
v0
=
tf
.
Variable
(
10.0
,
name
=
"v0"
)
...
...
@@ -867,7 +869,8 @@ class MutableDenseHashTableOpTest(tf.test.TestCase):
[
100
,
0
],
[
100
,
0
],
[
100
,
0
]],
pairs
)
def
testSaveRestore
(
self
):
save_path
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
"hash"
)
save_dir
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
"save_restore"
)
save_path
=
os
.
path
.
join
(
tempfile
.
mkdtemp
(
prefix
=
save_dir
),
"hash"
)
with
self
.
test_session
(
graph
=
tf
.
Graph
())
as
sess
:
default_value
=
-
1
...
...
@@ -922,7 +925,8 @@ class MutableDenseHashTableOpTest(tf.test.TestCase):
self
.
assertAllEqual
([
-
1
,
0
,
1
,
2
,
-
1
],
output
.
eval
())
def
testVectorSaveRestore
(
self
):
save_path
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
"hash"
)
save_dir
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
"vector_save_restore"
)
save_path
=
os
.
path
.
join
(
tempfile
.
mkdtemp
(
prefix
=
save_dir
),
"hash"
)
with
self
.
test_session
(
graph
=
tf
.
Graph
())
as
sess
:
empty_key
=
tf
.
constant
([
11
,
13
],
tf
.
int64
)
...
...
tensorflow/contrib/opt/python/training/moving_average_optimizer_test.py
浏览文件 @
49684837
...
...
@@ -18,6 +18,7 @@ from __future__ import division
from
__future__
import
print_function
import
os.path
import
tempfile
import
six
import
tensorflow
as
tf
...
...
@@ -40,7 +41,9 @@ class MovingAverageOptimizerTest(tf.test.TestCase):
tf
.
train
.
GradientDescentOptimizer
(
learning_rate
=
2.0
),
average_decay
=
0.5
,
sequential_update
=
sequential_update
)
save_path
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
'model'
)
save_dir
=
tempfile
.
mkdtemp
(
prefix
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
'run_1'
))
save_path
=
os
.
path
.
join
(
save_dir
,
'model'
)
update
=
opt
.
apply_gradients
(
list
(
six
.
moves
.
zip
([
grads0
,
grads1
],
[
var0
,
var1
])))
train_saver
=
opt
.
swapping_saver
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录