Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
57864f52
提交
57864f52
authored
12月 14, 2020
作者:
Michael Osthege
提交者:
Brandon T. Willard
12月 15, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move cmodule-related config registration to tests.gof.cmodule
This untangles the `theano.configdefaults` module from the `theano.gof` sub-package, thereby removing an import cycle. Closes #94
上级
ec994f62
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
17 行增加
和
16 行删除
+17
-16
test_cmodule.py
tests/gof/test_cmodule.py
+16
-1
test_config.py
tests/test_config.py
+1
-15
configdefaults.py
theano/configdefaults.py
+0
-0
cmodule.py
theano/gof/cmodule.py
+0
-0
没有找到文件。
tests/gof/test_cmodule.py
浏览文件 @
57864f52
...
...
@@ -5,11 +5,13 @@ But this one tests a current behavior that isn't good: the c_code isn't
deterministic based on the input type and the op.
"""
import
logging
from
unittest.mock
import
patch
import
numpy
as
np
import
theano
from
theano.gof.cmodule
import
GCC_compiler
from
theano.gof.cmodule
import
GCC_compiler
,
default_blas_ldflags
class
MyOp
(
theano
.
compile
.
ops
.
DeepCopyOp
):
...
...
@@ -68,3 +70,16 @@ def test_flag_detection():
# but was not detected because that path is not usually taken,
# so we test it here directly.
GCC_compiler
.
try_flags
([
"-lblas"
])
@patch
(
"theano.gof.cmodule.try_blas_flag"
,
return_value
=
None
)
@patch
(
"theano.gof.cmodule.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
tests/test_config.py
浏览文件 @
57864f52
"""Test config options."""
import
configparser
as
stdlib_configparser
import
logging
from
unittest.mock
import
patch
import
pytest
from
theano
import
configdefaults
,
configparser
from
theano.configdefaults
import
default_blas_ldflags
,
short_platform
from
theano.configdefaults
import
short_platform
from
theano.configparser
import
ConfigParam
...
...
@@ -287,15 +285,3 @@ class TestConfigHelperFunctions:
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
theano/configdefaults.py
浏览文件 @
57864f52
差异被折叠。
点击展开。
theano/gof/cmodule.py
浏览文件 @
57864f52
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论