Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c5da9237
提交
c5da9237
authored
7月 12, 2016
作者:
Frédéric Bastien
提交者:
GitHub
7月 12, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4726 from abergeron/fix_buildbot
Fix some problems in the buildbot
上级
a96b5ded
71c1bcbe
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
20 行增加
和
22 行删除
+20
-22
test_pickle.py
theano/gpuarray/tests/test_pickle.py
+6
-6
test_dnn.py
theano/sandbox/cuda/tests/test_dnn.py
+12
-14
test_pool.py
theano/tensor/signal/tests/test_pool.py
+2
-2
没有找到文件。
theano/gpuarray/tests/test_pickle.py
浏览文件 @
c5da9237
...
...
@@ -18,6 +18,8 @@ from theano.compat import PY3
from
theano
import
config
from
theano.misc.pkl_utils
import
CompatUnpickler
from
..type
import
ContextNotDefined
try
:
from
.
import
config
as
_
# noqa
have_pygpu
=
True
...
...
@@ -26,11 +28,9 @@ except SkipTest:
def
test_unpickle_gpuarray_as_numpy_ndarray_flag1
():
"""Only test when pygpu isn't
available. test_unpickle_gpuarray_as_numpy_ndarray_flag0 in
test_type.py test it when pygpu is there.
"""
# Only test when pygpu isn't
# available. test_unpickle_gpuarray_as_numpy_ndarray_flag0 in
# test_type.py test it when pygpu is there.
if
have_pygpu
:
raise
SkipTest
(
"pygpu active"
)
oldflag
=
config
.
experimental
.
unpickle_gpu_on_cpu
...
...
@@ -45,7 +45,7 @@ def test_unpickle_gpuarray_as_numpy_ndarray_flag1():
u
=
CompatUnpickler
(
fp
,
encoding
=
"latin1"
)
else
:
u
=
CompatUnpickler
(
fp
)
assert_raises
(
ImportError
,
u
.
load
)
assert_raises
(
(
ImportError
,
ContextNotDefined
)
,
u
.
load
)
finally
:
config
.
experimental
.
unpickle_gpu_on_cpu
=
oldflag
...
...
theano/sandbox/cuda/tests/test_dnn.py
浏览文件 @
c5da9237
...
...
@@ -723,7 +723,7 @@ def test_batchnorm_train():
utt
.
seed_rng
()
for
mode
in
(
'per-activation'
,
'spatial'
):
for
vartype
in
(
T
.
tensor4
,
T
.
tensor3
,
T
.
matrix
,
T
.
vector
):
for
vartype
in
(
T
.
ftensor4
,
T
.
ftensor3
,
T
.
fmatrix
,
T
.
f
vector
):
x
,
scale
,
bias
=
(
vartype
(
n
)
for
n
in
(
'x'
,
'scale'
,
'bias'
))
ndim
=
x
.
ndim
eps
=
5e-3
# some non-standard value to test if it's used
...
...
@@ -751,15 +751,14 @@ def test_batchnorm_train():
[
out
,
x_mean
,
x_invstd
,
out2
,
x_mean2
,
x_invstd2
]
+
grads
+
grads2
,
mode
=
mode_with_gpu
)
# run
floatX
=
theano
.
config
.
floatX
for
data_shape
in
((
10
,
20
,
30
,
40
),
(
4
,
3
,
1
,
1
),
(
1
,
1
,
5
,
5
)):
data_shape
=
data_shape
[:
ndim
]
param_shape
=
tuple
(
1
if
d
in
axes
else
s
for
d
,
s
in
enumerate
(
data_shape
))
X
=
4
+
3
*
numpy
.
random
.
randn
(
*
data_shape
)
.
astype
(
floatX
)
Dy
=
-
1
+
2
*
numpy
.
random
.
randn
(
*
data_shape
)
.
astype
(
floatX
)
Scale
=
numpy
.
random
.
randn
(
*
param_shape
)
.
astype
(
floatX
)
Bias
=
numpy
.
random
.
randn
(
*
param_shape
)
.
astype
(
floatX
)
X
=
4
+
3
*
numpy
.
random
.
randn
(
*
data_shape
)
.
astype
(
'float32'
)
Dy
=
-
1
+
2
*
numpy
.
random
.
randn
(
*
data_shape
)
.
astype
(
'float32'
)
Scale
=
numpy
.
random
.
randn
(
*
param_shape
)
.
astype
(
'float32'
)
Bias
=
numpy
.
random
.
randn
(
*
param_shape
)
.
astype
(
'float32'
)
outputs
=
f
(
X
,
Scale
,
Bias
,
Dy
)
# compare outputs
utt
.
assert_allclose
(
outputs
[
0
],
outputs
[
0
+
3
])
# out
...
...
@@ -779,7 +778,7 @@ def test_batchnorm_inference():
utt
.
seed_rng
()
for
mode
in
(
'per-activation'
,
'spatial'
):
for
vartype
in
(
T
.
tensor4
,
T
.
tensor3
,
T
.
matrix
,
T
.
vector
):
for
vartype
in
(
T
.
ftensor4
,
T
.
ftensor3
,
T
.
fmatrix
,
T
.
f
vector
):
x
,
scale
,
bias
,
mean
,
var
=
(
vartype
(
n
)
for
n
in
(
'x'
,
'scale'
,
'bias'
,
'mean'
,
'var'
))
...
...
@@ -806,17 +805,16 @@ def test_batchnorm_inference():
f
=
theano
.
function
([
x
,
scale
,
bias
,
mean
,
var
,
dy
],
[
out
,
out2
]
+
grads
+
grads2
,
mode
=
mode_with_gpu
)
# run
floatX
=
theano
.
config
.
floatX
for
data_shape
in
((
10
,
20
,
30
,
40
),
(
4
,
3
,
1
,
1
),
(
1
,
1
,
5
,
5
)):
data_shape
=
data_shape
[:
ndim
]
param_shape
=
tuple
(
1
if
d
in
axes
else
s
for
d
,
s
in
enumerate
(
data_shape
))
X
=
4
+
3
*
numpy
.
random
.
randn
(
*
data_shape
)
.
astype
(
floatX
)
Dy
=
-
1
+
2
*
numpy
.
random
.
randn
(
*
data_shape
)
.
astype
(
floatX
)
Scale
=
numpy
.
random
.
randn
(
*
param_shape
)
.
astype
(
floatX
)
Bias
=
numpy
.
random
.
randn
(
*
param_shape
)
.
astype
(
floatX
)
Mean
=
numpy
.
random
.
randn
(
*
param_shape
)
.
astype
(
floatX
)
Var
=
numpy
.
random
.
rand
(
*
param_shape
)
.
astype
(
floatX
)
X
=
4
+
3
*
numpy
.
random
.
randn
(
*
data_shape
)
.
astype
(
'float32'
)
Dy
=
-
1
+
2
*
numpy
.
random
.
randn
(
*
data_shape
)
.
astype
(
'float32'
)
Scale
=
numpy
.
random
.
randn
(
*
param_shape
)
.
astype
(
'float32'
)
Bias
=
numpy
.
random
.
randn
(
*
param_shape
)
.
astype
(
'float32'
)
Mean
=
numpy
.
random
.
randn
(
*
param_shape
)
.
astype
(
'float32'
)
Var
=
numpy
.
random
.
rand
(
*
param_shape
)
.
astype
(
'float32'
)
outputs
=
f
(
X
,
Scale
,
Bias
,
Mean
,
Var
,
Dy
)
# compare outputs
utt
.
assert_allclose
(
outputs
[
0
],
outputs
[
1
])
# out
...
...
theano/tensor/signal/tests/test_pool.py
浏览文件 @
c5da9237
...
...
@@ -35,8 +35,8 @@ class TestDownsampleFactorMax(utt.InferShapeTester):
if
input
.
shape
[
-
1
]
%
ds
[
1
]:
yi
+=
1
out_shp
=
list
(
input
.
shape
[:
-
2
])
out_shp
.
append
(
input
.
shape
[
-
2
]
/
ds
[
0
]
+
xi
)
out_shp
.
append
(
input
.
shape
[
-
1
]
/
ds
[
1
]
+
yi
)
out_shp
.
append
(
input
.
shape
[
-
2
]
/
/
ds
[
0
]
+
xi
)
out_shp
.
append
(
input
.
shape
[
-
1
]
/
/
ds
[
1
]
+
yi
)
output_val
=
numpy
.
zeros
(
out_shp
)
func
=
numpy
.
max
if
mode
==
'sum'
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论