Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
075c53bd
提交
075c53bd
authored
3月 23, 2011
作者:
David Warde-Farley
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change auxillary functions from _tests to _checks so as not to trigger nose.
上级
2ed88a6d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
15 行增加
和
12 行删除
+15
-12
test_basic.py
theano/tensor/tests/test_basic.py
+15
-12
没有找到文件。
theano/tensor/tests/test_basic.py
浏览文件 @
075c53bd
...
@@ -855,7 +855,7 @@ def rand_of_dtype(shape, dtype):
...
@@ -855,7 +855,7 @@ def rand_of_dtype(shape, dtype):
else
:
else
:
raise
TypeError
()
raise
TypeError
()
def
multi_dtype_
test
s
(
shape1
,
shape2
,
dtypes
=
ALL_DTYPES
,
nameprefix
=
''
):
def
multi_dtype_
check
s
(
shape1
,
shape2
,
dtypes
=
ALL_DTYPES
,
nameprefix
=
''
):
for
dtype1
,
dtype2
in
combinations
(
dtypes
,
2
):
for
dtype1
,
dtype2
in
combinations
(
dtypes
,
2
):
name1
=
'
%
s_
%
s_
%
s'
%
(
nameprefix
,
dtype1
,
dtype2
)
name1
=
'
%
s_
%
s_
%
s'
%
(
nameprefix
,
dtype1
,
dtype2
)
name2
=
'
%
s_
%
s_
%
s'
%
(
nameprefix
,
dtype2
,
dtype1
)
name2
=
'
%
s_
%
s_
%
s'
%
(
nameprefix
,
dtype2
,
dtype1
)
...
@@ -864,7 +864,7 @@ def multi_dtype_tests(shape1, shape2, dtypes=ALL_DTYPES, nameprefix=''):
...
@@ -864,7 +864,7 @@ def multi_dtype_tests(shape1, shape2, dtypes=ALL_DTYPES, nameprefix=''):
yield
(
name1
,
(
obj1
,
obj2
))
yield
(
name1
,
(
obj1
,
obj2
))
yield
(
name2
,
(
obj2
,
obj1
))
yield
(
name2
,
(
obj2
,
obj1
))
def
multi_dtype_cast_
test
s
(
shape
,
dtypes
=
ALL_DTYPES
,
nameprefix
=
''
):
def
multi_dtype_cast_
check
s
(
shape
,
dtypes
=
ALL_DTYPES
,
nameprefix
=
''
):
for
dtype1
,
dtype2
in
combinations
(
dtypes
,
2
):
for
dtype1
,
dtype2
in
combinations
(
dtypes
,
2
):
name1
=
'
%
s_
%
s_
%
s'
%
(
nameprefix
,
dtype1
,
dtype2
)
name1
=
'
%
s_
%
s_
%
s'
%
(
nameprefix
,
dtype1
,
dtype2
)
name2
=
'
%
s_
%
s_
%
s'
%
(
nameprefix
,
dtype2
,
dtype1
)
name2
=
'
%
s_
%
s_
%
s'
%
(
nameprefix
,
dtype2
,
dtype1
)
...
@@ -878,9 +878,9 @@ SecondBroadcastTester = makeTester(
...
@@ -878,9 +878,9 @@ SecondBroadcastTester = makeTester(
op
=
second
,
op
=
second
,
expected
=
_numpy_second
,
expected
=
_numpy_second
,
good
=
dict
(
itertools
.
chain
(
good
=
dict
(
itertools
.
chain
(
multi_dtype_
test
s
((
4
,
5
),
(
5
,)),
multi_dtype_
check
s
((
4
,
5
),
(
5
,)),
multi_dtype_
test
s
((
2
,
3
,
2
),
(
3
,
2
)),
multi_dtype_
check
s
((
2
,
3
,
2
),
(
3
,
2
)),
multi_dtype_
test
s
((
2
,
3
,
2
),
(
2
,)),
multi_dtype_
check
s
((
2
,
3
,
2
),
(
2
,)),
)),
)),
# I can't think of any way to make this fail at
# I can't think of any way to make this fail at
# build time
# build time
...
@@ -898,12 +898,14 @@ SecondSameRankTester = makeTester(
...
@@ -898,12 +898,14 @@ SecondSameRankTester = makeTester(
op
=
second
,
op
=
second
,
expected
=
_numpy_second
,
expected
=
_numpy_second
,
good
=
dict
(
itertools
.
chain
(
good
=
dict
(
itertools
.
chain
(
multi_dtype_
test
s
((
4
,
5
),
(
4
,
5
)),
multi_dtype_
check
s
((
4
,
5
),
(
4
,
5
)),
multi_dtype_
tests
((
5
,
4
),
(
4
,
5
)),
multi_dtype_
checks
((
1
,
2
),
(
3
,
2
)),
multi_dtype_
tests
((
1
,
4
),
(
3
,
2
)),
multi_dtype_
checks
((
3
,
2
),
(
1
,
2
)),
)),
)),
bad_build
=
None
,
bad_runtime
=
dict
(
itertools
.
chain
(
bad_runtime
=
None
multi_dtype_checks
((
4
,
5
),
(
5
,
4
)),
multi_dtype_checks
((
1
,
5
),
(
5
,
4
)),
))
)
)
CastTester
=
makeTester
(
CastTester
=
makeTester
(
...
@@ -911,8 +913,9 @@ CastTester = makeTester(
...
@@ -911,8 +913,9 @@ CastTester = makeTester(
op
=
cast
,
op
=
cast
,
expected
=
lambda
x
,
y
:
x
.
astype
(
y
),
expected
=
lambda
x
,
y
:
x
.
astype
(
y
),
good
=
dict
(
itertools
.
chain
(
good
=
dict
(
itertools
.
chain
(
multi_dtype_cast_tests
((
2
,)),
multi_dtype_cast_checks
((
2
,)),
[(
'
%
s_
%
s'
%
(
dtype
,
dtype
),
# Casts from foo to foo
[(
'
%
s_
%
s'
%
(
rand_of_dtype
((
2
,),
dtype
),
dtype
),
(
rand_of_dtype
((
2
,),
dtype
),
dtype
))
(
rand_of_dtype
((
2
,),
dtype
),
dtype
))
for
dtype
in
ALL_DTYPES
]
for
dtype
in
ALL_DTYPES
]
)),
)),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论