Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_38905368
tensorflow
提交
7dcebc86
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,体验更适合开发者的 AI 搜索 >>
提交
7dcebc86
编写于
12月 13, 2018
作者:
A
A. Unique TensorFlower
提交者:
TensorFlower Gardener
12月 13, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adds all Keras modes to `convolutional_test`
PiperOrigin-RevId: 225397991
上级
4d810848
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
35 deletion
+40
-35
tensorflow/python/keras/BUILD
tensorflow/python/keras/BUILD
+1
-1
tensorflow/python/keras/backend.py
tensorflow/python/keras/backend.py
+4
-0
tensorflow/python/keras/layers/convolutional_test.py
tensorflow/python/keras/layers/convolutional_test.py
+35
-34
未找到文件。
tensorflow/python/keras/BUILD
浏览文件 @
7dcebc86
...
...
@@ -369,7 +369,7 @@ py_test(
name
=
"convolutional_test"
,
size
=
"large"
,
srcs
=
[
"layers/convolutional_test.py"
],
shard_count
=
4
,
shard_count
=
11
,
srcs_version
=
"PY2AND3"
,
deps
=
[
":keras"
,
...
...
tensorflow/python/keras/backend.py
浏览文件 @
7dcebc86
...
...
@@ -568,6 +568,10 @@ def _get_available_gpus():
Returns:
A list of available GPU devices.
"""
if
ops
.
executing_eagerly_outside_functions
():
# Returns names of devices directly.
return
[
name
for
name
in
context
.
list_devices
()
if
'GPU'
in
name
]
global
_LOCAL_DEVICES
if
_LOCAL_DEVICES
is
None
:
_LOCAL_DEVICES
=
get_session
().
list_devices
()
...
...
tensorflow/python/keras/layers/convolutional_test.py
浏览文件 @
7dcebc86
...
...
@@ -24,13 +24,13 @@ import numpy as np
from
tensorflow.python
import
keras
from
tensorflow.python.eager
import
context
from
tensorflow.python.
framework
import
test_util
as
tf_test_util
from
tensorflow.python.
keras
import
keras_parameterized
from
tensorflow.python.keras
import
testing_utils
from
tensorflow.python.platform
import
test
@
tf_test_util
.
run_all_in_graph_and_eager
_modes
class
Convolution1DTest
(
test
.
TestCase
):
@
keras_parameterized
.
run_all_keras
_modes
class
Convolution1DTest
(
keras_parameterized
.
TestCase
):
def
_run_test
(
self
,
kwargs
,
arg
,
values
):
num_samples
=
2
...
...
@@ -100,8 +100,8 @@ class Convolution1DTest(test.TestCase):
self
.
assertEqual
(
layer
.
bias
.
constraint
,
b_constraint
)
@
tf_test_util
.
run_all_in_graph_and_eager
_modes
class
Conv2DTest
(
test
.
TestCase
):
@
keras_parameterized
.
run_all_keras
_modes
class
Conv2DTest
(
keras_parameterized
.
TestCase
):
def
_run_test
(
self
,
kwargs
,
arg
,
values
):
num_samples
=
2
...
...
@@ -175,8 +175,8 @@ class Conv2DTest(test.TestCase):
self
.
assertEqual
(
layer
.
bias
.
constraint
,
b_constraint
)
@
tf_test_util
.
run_all_in_graph_and_eager
_modes
class
Conv2DTransposeTest
(
test
.
TestCase
):
@
keras_parameterized
.
run_all_keras
_modes
class
Conv2DTransposeTest
(
keras_parameterized
.
TestCase
):
def
_run_test
(
self
,
kwargs
,
arg
,
values
):
num_samples
=
2
...
...
@@ -267,8 +267,8 @@ class Conv2DTransposeTest(test.TestCase):
expected_output
=
expected_output
)
@
tf_test_util
.
run_all_in_graph_and_eager
_modes
class
Conv3DTransposeTest
(
test
.
TestCase
):
@
keras_parameterized
.
run_all_keras
_modes
class
Conv3DTransposeTest
(
keras_parameterized
.
TestCase
):
def
_run_test
(
self
,
kwargs
,
arg
,
values
):
num_samples
=
2
...
...
@@ -336,8 +336,8 @@ class Conv3DTransposeTest(test.TestCase):
self
.
assertEqual
(
layer
.
bias
.
constraint
,
b_constraint
)
@
tf_test_util
.
run_all_in_graph_and_eager
_modes
class
SeparableConv1DTest
(
test
.
TestCase
):
@
keras_parameterized
.
run_all_keras
_modes
class
SeparableConv1DTest
(
keras_parameterized
.
TestCase
):
def
_run_test
(
self
,
kwargs
,
arg
,
values
):
num_samples
=
2
...
...
@@ -411,8 +411,8 @@ class SeparableConv1DTest(test.TestCase):
self
.
assertEqual
(
layer
.
bias
.
constraint
,
b_constraint
)
@
tf_test_util
.
run_all_in_graph_and_eager
_modes
class
SeparableConv2DTest
(
test
.
TestCase
):
@
keras_parameterized
.
run_all_keras
_modes
class
SeparableConv2DTest
(
keras_parameterized
.
TestCase
):
def
_run_test
(
self
,
kwargs
,
arg
,
values
):
num_samples
=
2
...
...
@@ -489,8 +489,8 @@ class SeparableConv2DTest(test.TestCase):
self
.
assertEqual
(
layer
.
bias
.
constraint
,
b_constraint
)
@
tf_test_util
.
run_all_in_graph_and_eager
_modes
class
Conv3DTest
(
test
.
TestCase
):
@
keras_parameterized
.
run_all_keras
_modes
class
Conv3DTest
(
keras_parameterized
.
TestCase
):
def
_run_test
(
self
,
kwargs
,
arg
,
values
):
num_samples
=
2
...
...
@@ -557,8 +557,8 @@ class Conv3DTest(test.TestCase):
self
.
assertEqual
(
layer
.
bias
.
constraint
,
b_constraint
)
@
tf_test_util
.
run_all_in_graph_and_eager
_modes
class
ZeroPaddingTest
(
test
.
TestCase
):
@
keras_parameterized
.
run_all_keras
_modes
class
ZeroPaddingTest
(
keras_parameterized
.
TestCase
):
def
test_zero_padding_1d
(
self
):
num_samples
=
2
...
...
@@ -726,8 +726,8 @@ class ZeroPaddingTest(test.TestCase):
keras
.
layers
.
ZeroPadding3D
(
padding
=
None
)
@
tf_test_util
.
run_all_in_graph_and_eager
_modes
class
UpSamplingTest
(
test
.
TestCase
):
@
keras_parameterized
.
run_all_keras
_modes
class
UpSamplingTest
(
keras_parameterized
.
TestCase
):
def
test_upsampling_1d
(
self
):
with
self
.
session
(
use_gpu
=
True
):
...
...
@@ -875,8 +875,8 @@ class UpSamplingTest(test.TestCase):
np
.
testing
.
assert_allclose
(
np_output
,
expected_out
)
@
tf_test_util
.
run_all_in_graph_and_eager
_modes
class
CroppingTest
(
test
.
TestCase
):
@
keras_parameterized
.
run_all_keras
_modes
class
CroppingTest
(
keras_parameterized
.
TestCase
):
def
test_cropping_1d
(
self
):
num_samples
=
2
...
...
@@ -1017,8 +1017,8 @@ class CroppingTest(test.TestCase):
keras
.
layers
.
Cropping3D
(
cropping
=
None
)
@
tf_test_util
.
run_all_in_graph_and_eager
_modes
class
DepthwiseConv2DTest
(
test
.
TestCase
):
@
keras_parameterized
.
run_all_keras
_modes
class
DepthwiseConv2DTest
(
keras_parameterized
.
TestCase
):
def
_run_test
(
self
,
kwargs
,
arg
,
values
):
num_samples
=
2
...
...
@@ -1044,17 +1044,18 @@ class DepthwiseConv2DTest(test.TestCase):
self
.
_run_test
(
kwargs
,
'data_format'
,
[
'channels_first'
])
self
.
_run_test
(
kwargs
,
'depth_multiplier'
,
[
1
,
2
])
kwargs
=
{
'kernel_size'
:
3
,
'padding'
:
'valid'
,
'data_format'
:
'channels_first'
,
'activation'
:
None
,
'depthwise_regularizer'
:
'l2'
,
'bias_regularizer'
:
'l2'
,
'activity_regularizer'
:
'l2'
,
'depthwise_constraint'
:
'unit_norm'
,
'use_bias'
:
True
,
'strides'
:
(
2
,
2
),
}
kwargs
=
{
'kernel_size'
:
3
,
'padding'
:
'valid'
,
'data_format'
:
'channels_last'
,
'activation'
:
None
,
'depthwise_regularizer'
:
'l2'
,
'bias_regularizer'
:
'l2'
,
'activity_regularizer'
:
'l2'
,
'depthwise_constraint'
:
'unit_norm'
,
'use_bias'
:
True
,
'strides'
:
(
2
,
2
),
}
self
.
_run_test
(
kwargs
,
'depth_multiplier'
,
[
1
])
if
__name__
==
'__main__'
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录