Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
2711f775
提交
2711f775
authored
9月 21, 2016
作者:
Frédéric Bastien
提交者:
GitHub
9月 21, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4991 from nouiz/test_gc_never_pickles_temporaries
Better error message to help debug travis problem
上级
e8f9541d
0b2fa521
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
5 行删除
+17
-5
.travis.yml
.travis.yml
+2
-2
test_gc.py
theano/tensor/tests/test_gc.py
+15
-3
没有找到文件。
.travis.yml
浏览文件 @
2711f775
...
@@ -31,12 +31,12 @@ addons:
...
@@ -31,12 +31,12 @@ addons:
install
:
install
:
# In Python 3.3, we test the min version of NumPy and SciPy. In Python 2.7, we test more recent version.
# In Python 3.3, we test the min version of NumPy and SciPy. In Python 2.7, we test more recent version.
-
if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then conda create --yes -q -n pyenv mkl python=2.7 numpy=1.
11.1 scipy=0.18 nose=1.3.0 pip flake8=2.3 six=1.9.0 pep8=1.6.2 pyflakes=0.8.1 sphinx mkl-service
; fi
-
if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then conda create --yes -q -n pyenv mkl python=2.7 numpy=1.
9.1 scipy=0.14.0 nose=1.3.0 pip flake8=2.3 six=1.9.0 pep8=1.6.2 pyflakes=0.8.1 sphinx mkl-service libgfortran=1
; fi
-
if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then conda create --yes -q -n pyenv mkl python=3.3 numpy=1.9.1 scipy=0.14.0 nose=1.3.4 pip flake8=2.3 six=1.9.0 pep8=1.6.2 pyflakes=0.8.1 sphinx mkl-service; fi
-
if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then conda create --yes -q -n pyenv mkl python=3.3 numpy=1.9.1 scipy=0.14.0 nose=1.3.4 pip flake8=2.3 six=1.9.0 pep8=1.6.2 pyflakes=0.8.1 sphinx mkl-service; fi
-
source activate pyenv
-
source activate pyenv
-
if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install pydot; else pip install pydot-ng; fi
-
if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install pydot; else pip install pydot-ng; fi
-
pip install . --no-deps
-
pip install . --no-deps
-
pip install flake8-future-import nose-parameterized==0.5.0
-
pip install flake8-future-import nose-parameterized==0.5.0
sphinx_rtd_theme
# command to run tests
# command to run tests
env
:
env
:
...
...
theano/tensor/tests/test_gc.py
浏览文件 @
2711f775
...
@@ -49,8 +49,10 @@ def test_gc_never_pickles_temporaries():
...
@@ -49,8 +49,10 @@ def test_gc_never_pickles_temporaries():
g
=
theano
.
function
([
x
],
r
,
mode
=
theano
.
Mode
(
optimizer
=
optimizer
,
g
=
theano
.
function
([
x
],
r
,
mode
=
theano
.
Mode
(
optimizer
=
optimizer
,
linker
=
g_linker
))
linker
=
g_linker
))
len_pre_f
=
len
(
pickle
.
dumps
(
f
))
pre_f
=
pickle
.
dumps
(
f
)
len_pre_g
=
len
(
pickle
.
dumps
(
g
))
pre_g
=
pickle
.
dumps
(
g
)
len_pre_f
=
len
(
pre_f
)
len_pre_g
=
len
(
pre_g
)
# We can't compare the content or the length of the string
# We can't compare the content or the length of the string
# between f and g. 2 reason, we store some timming information
# between f and g. 2 reason, we store some timming information
...
@@ -87,7 +89,17 @@ def test_gc_never_pickles_temporaries():
...
@@ -87,7 +89,17 @@ def test_gc_never_pickles_temporaries():
# assert that f() didn't cause the function to grow
# assert that f() didn't cause the function to grow
# allow_gc should leave the function un-changed by calling
# allow_gc should leave the function un-changed by calling
assert
len_pre_f
==
len_post_f
if
len_pre_f
!=
len_post_f
:
for
i
in
range
(
len_pre_f
//
100
):
p1
=
pre_f
[
i
*
100
:(
i
+
1
)
*
100
]
p2
=
post_f
[
i
*
100
:(
i
+
1
)
*
100
]
if
p1
!=
p2
:
print
(
i
)
print
(
"p1"
)
print
(
p1
)
print
(
"p2"
)
print
(
p2
)
assert
len_pre_f
==
len_post_f
,
(
len_pre_f
,
len_post_f
)
# assert that g() didn't cause g to grow because temporaries
# assert that g() didn't cause g to grow because temporaries
# that weren't collected shouldn't be pickled anyway
# that weren't collected shouldn't be pickled anyway
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论