Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
8b96d5f4
提交
8b96d5f4
authored
12月 14, 2020
作者:
Michael Osthege
提交者:
Brandon T. Willard
12月 15, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move config-related test from tests.gof.test_compiledir into tests.test_config
上级
819122e6
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
44 行增加
和
42 行删除
+44
-42
test_compiledir.py
tests/gof/test_compiledir.py
+0
-28
test_config.py
tests/test_config.py
+44
-14
没有找到文件。
tests/gof/test_compiledir.py
deleted
100644 → 0
浏览文件 @
819122e6
from
theano.configdefaults
import
short_platform
def
test_short_platform
():
for
r
,
p
,
a
in
[
# (release, platform, answer)
(
"3.2.0-70-generic"
,
"Linux-3.2.0-70-generic-x86_64-with-debian-wheezy-sid"
,
"Linux-3.2--generic-x86_64-with-debian-wheezy-sid"
,
),
(
"3.2.0-70.1-generic"
,
"Linux-3.2.0-70.1-generic-x86_64-with-debian-wheezy-sid"
,
"Linux-3.2--generic-x86_64-with-debian-wheezy-sid"
,
),
(
"3.2.0-70.1.2-generic"
,
"Linux-3.2.0-70.1.2-generic-x86_64-with-debian-wheezy-sid"
,
"Linux-3.2--generic-x86_64-with-debian-wheezy-sid"
,
),
(
"2.6.35.14-106.fc14.x86_64"
,
"Linux-2.6.35.14-106.fc14.x86_64-x86_64-with-fedora-14-Laughlin"
,
"Linux-2.6-fc14.x86_64-x86_64-with-fedora-14-Laughlin"
,
),
]:
o
=
short_platform
(
r
,
p
)
assert
o
==
a
,
(
o
,
a
)
tests/test_config.py
浏览文件 @
8b96d5f4
...
@@ -6,7 +6,7 @@ from unittest.mock import patch
...
@@ -6,7 +6,7 @@ from unittest.mock import patch
import
pytest
import
pytest
from
theano
import
configdefaults
,
configparser
from
theano
import
configdefaults
,
configparser
from
theano.configdefaults
import
default_blas_ldflags
from
theano.configdefaults
import
default_blas_ldflags
,
short_platform
from
theano.configparser
import
ConfigParam
from
theano.configparser
import
ConfigParam
...
@@ -98,19 +98,6 @@ def test_invalid_default():
...
@@ -98,19 +98,6 @@ def test_invalid_default():
assert
"test__test_invalid_default_b"
not
in
root
.
_flags_dict
assert
"test__test_invalid_default_b"
not
in
root
.
_flags_dict
@patch
(
"theano.configdefaults.try_blas_flag"
,
return_value
=
None
)
@patch
(
"theano.configdefaults.sys"
)
def
test_default_blas_ldflags
(
sys_mock
,
try_blas_flag_mock
,
caplog
):
sys_mock
.
version
=
"3.8.0 | packaged by conda-forge | (default, Nov 22 2019, 19:11:38)
\n
[GCC 7.3.0]"
with
patch
.
dict
(
"sys.modules"
,
{
"mkl"
:
None
}):
with
caplog
.
at_level
(
logging
.
WARNING
):
default_blas_ldflags
()
assert
"install mkl with"
in
caplog
.
text
def
test_config_param_apply_and_validation
():
def
test_config_param_apply_and_validation
():
cp
=
ConfigParam
(
cp
=
ConfigParam
(
"TheDeFauLt"
,
"TheDeFauLt"
,
...
@@ -269,3 +256,46 @@ def test_mode_apply():
...
@@ -269,3 +256,46 @@ def test_mode_apply():
configdefaults
.
filter_mode
(
theano
.
compile
.
mode
.
FAST_COMPILE
)
configdefaults
.
filter_mode
(
theano
.
compile
.
mode
.
FAST_COMPILE
)
==
theano
.
compile
.
mode
.
FAST_COMPILE
==
theano
.
compile
.
mode
.
FAST_COMPILE
)
)
class
TestConfigHelperFunctions
:
@pytest.mark.parametrize
(
"release,platform,answer"
,
[
(
"3.2.0-70-generic"
,
"Linux-3.2.0-70-generic-x86_64-with-debian-wheezy-sid"
,
"Linux-3.2--generic-x86_64-with-debian-wheezy-sid"
,
),
(
"3.2.0-70.1-generic"
,
"Linux-3.2.0-70.1-generic-x86_64-with-debian-wheezy-sid"
,
"Linux-3.2--generic-x86_64-with-debian-wheezy-sid"
,
),
(
"3.2.0-70.1.2-generic"
,
"Linux-3.2.0-70.1.2-generic-x86_64-with-debian-wheezy-sid"
,
"Linux-3.2--generic-x86_64-with-debian-wheezy-sid"
,
),
(
"2.6.35.14-106.fc14.x86_64"
,
"Linux-2.6.35.14-106.fc14.x86_64-x86_64-with-fedora-14-Laughlin"
,
"Linux-2.6-fc14.x86_64-x86_64-with-fedora-14-Laughlin"
,
),
],
)
def
test_short_platform
(
self
,
release
,
platform
,
answer
):
o
=
short_platform
(
release
,
platform
)
assert
o
==
answer
,
(
o
,
answer
)
@patch
(
"theano.configdefaults.try_blas_flag"
,
return_value
=
None
)
@patch
(
"theano.configdefaults.sys"
)
def
test_default_blas_ldflags
(
self
,
sys_mock
,
try_blas_flag_mock
,
caplog
):
sys_mock
.
version
=
"3.8.0 | packaged by conda-forge | (default, Nov 22 2019, 19:11:38)
\n
[GCC 7.3.0]"
with
patch
.
dict
(
"sys.modules"
,
{
"mkl"
:
None
}):
with
caplog
.
at_level
(
logging
.
WARNING
):
default_blas_ldflags
()
assert
"install mkl with"
in
caplog
.
text
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论