Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
7aaee1fa
提交
7aaee1fa
authored
12月 12, 2008
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
first implementation of one test and added template for 2 new test idea.
上级
53ca7d6f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
39 行增加
和
19 行删除
+39
-19
test_module.py
theano/compile/tests/test_module.py
+39
-19
没有找到文件。
theano/compile/tests/test_module.py
浏览文件 @
7aaee1fa
...
@@ -39,28 +39,38 @@ class T_test_module(unittest.TestCase):
...
@@ -39,28 +39,38 @@ class T_test_module(unittest.TestCase):
m1
.
make
()
m1
.
make
()
print
>>
sys
.
stderr
,
"WARNING MODULE TEST NOT IMPLEMENTED1"
print
>>
sys
.
stderr
,
"WARNING MODULE TEST NOT IMPLEMENTED1"
def
test_members_in_list_or_dict
(
self
):
def
test_members_in_list_
tuple_
or_dict
(
self
):
"""Test that a Member which is only included via a list or dictionary is still treated as if it
"""Test that a Member which is only included via a list
, tuple
or dictionary is still treated as if it
were a toplevel attribute
were a toplevel attribute
Fred: toplevel attribute? toplevel member?
Fred: toplevel attribute? do you mean as a toplevel member? m1.x=x work as m1.lx=[x]?
Fred: why list,tuple of result are casted to member?
Fred: why no wrapper for dict? Should I add one?
"""
"""
x
=
T
.
dscalar
()
def
local_test
(
x
,
y
):
y
=
Member
(
T
.
dscalar
())
m1
=
Module
()
m1
=
Module
()
m1
.
lx
=
[
x
]
#cast Result]
m1
.
lx
=
[
x
]
m1
.
ly
=
[
y
]
m1
.
ly
=
[
y
]
m1
.
dx
=
{
"x"
:
x
}
m1
.
dx
=
{
"x"
:
x
}
m1
.
dy
=
{
"y"
:
y
}
m1
.
dy
=
{
"y"
:
y
}
m1
.
tx
=
(
x
,)
m1
.
x
=
x
m1
.
ty
=
(
y
,)
m1
.
y
=
y
m1
.
x
=
x
inst
=
m1
.
make
()
m1
.
y
=
y
print
m1
inst
=
m1
.
make
()
print
inst
assert
inst
.
lx
assert
inst
.
lx
assert
inst
.
ly
assert
inst
.
ly
assert
inst
.
tx
self
.
assertRaises
(
AttributeError
,
inst
.
__getattr__
,
x
)
assert
inst
.
ty
self
.
assertRaises
(
AttributeError
,
inst
.
__getattr__
,
y
)
#FRED why this raise an exception?
inst
.
y
# we don't assert just make the look up as with T.dscalar it return None
# but it don't return None for value and constant
self
.
assertRaises
(
AttributeError
,
inst
.
__getattr__
,
"x"
)
self
.
assertRaises
(
AttributeError
,
inst
.
__getattr__
,
"dx"
)
self
.
assertRaises
(
AttributeError
,
inst
.
__getattr__
,
"dy"
)
local_test
(
T
.
dscalar
(),
Member
(
T
.
dscalar
()))
local_test
(
T
.
value
(
1
),
Member
(
T
.
value
(
2
)))
local_test
(
T
.
constant
(
1
),
Member
(
T
.
constant
(
2
)))
print
>>
sys
.
stderr
,
"WARNING MODULE TEST NOT IMPLEMENTED2"
print
>>
sys
.
stderr
,
"WARNING MODULE TEST NOT IMPLEMENTED2"
def
test_method_in_list_or_dict
(
self
):
def
test_method_in_list_or_dict
(
self
):
...
@@ -119,3 +129,13 @@ class T_test_module(unittest.TestCase):
...
@@ -119,3 +129,13 @@ class T_test_module(unittest.TestCase):
"""Test that Module.make(self) can take the same list of Modes that function can, so we can
"""Test that Module.make(self) can take the same list of Modes that function can, so we can
debug modules"""
debug modules"""
print
>>
sys
.
stderr
,
"WARNING MODULE TEST NOT IMPLEMENTED"
print
>>
sys
.
stderr
,
"WARNING MODULE TEST NOT IMPLEMENTED"
def
test_member_value
(
self
):
"""Test that module Members of Value work correctly. As Result?"""
print
>>
sys
.
stderr
,
"WARNING MODULE TEST NOT IMPLEMENTED"
def
test_member_constant
(
self
):
"""Test that module Members of Constant work correctly.
As Result with more optimization?"""
print
>>
sys
.
stderr
,
"WARNING MODULE TEST NOT IMPLEMENTED"
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论