Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f0a58c50
提交
f0a58c50
authored
10月 13, 2016
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix almost all the tests.
上级
12b74a54
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
18 行增加
和
21 行删除
+18
-21
test_basic.py
theano/tensor/tests/test_basic.py
+2
-2
test_elemwise.py
theano/tensor/tests/test_elemwise.py
+15
-18
type.py
theano/tensor/type.py
+1
-1
没有找到文件。
theano/tensor/tests/test_basic.py
浏览文件 @
f0a58c50
...
...
@@ -4996,7 +4996,7 @@ class T_scalarfromtensor(unittest.TestCase):
self
.
assertTrue
(
v
==
56
,
v
)
if
config
.
cast_policy
==
'custom'
:
self
.
assertTrue
(
isinstance
(
v
,
numpy
.
int
16
))
self
.
assertTrue
(
isinstance
(
v
,
numpy
.
int
8
))
elif
config
.
cast_policy
in
(
'numpy'
,
'numpy+floatX'
):
self
.
assertTrue
(
isinstance
(
v
,
getattr
(
numpy
,
str
(
numpy
.
asarray
(
56
)
.
dtype
))))
...
...
@@ -7108,7 +7108,7 @@ class T_as_tensor_variable(unittest.TestCase):
def
test_ndarray_bool
(
self
):
ten
=
as_tensor_variable
(
numpy
.
array
([
True
,
False
,
False
,
True
,
True
]))
assert
ten
.
type
.
dtype
==
'
uint8
'
assert
ten
.
type
.
dtype
==
'
bool
'
def
test_memmap
(
self
):
inp
=
numpy
.
random
.
rand
(
4
,
3
)
...
...
theano/tensor/tests/test_elemwise.py
浏览文件 @
f0a58c50
...
...
@@ -812,6 +812,7 @@ class T_reduce_dtype(unittest.TestCase):
def
test_reduce_default_acc_dtype
(
self
):
# Test the default acc_dtype of a reduce().
# We try multiple axis combinations even though axis should not matter.
for
method
in
self
.
methods
:
for
idx
,
dtype
in
enumerate
(
self
.
dtypes
):
...
...
@@ -839,6 +840,7 @@ class T_reduce_dtype(unittest.TestCase):
@attr
(
'slow'
)
def
test_reduce_custom_dtype
(
self
):
# Test the ability to provide your own output dtype for a reduce.
# We try multiple axis combinations even though axis should not matter.
idx
=
0
for
method
in
self
.
methods
:
...
...
@@ -872,6 +874,7 @@ class T_reduce_dtype(unittest.TestCase):
def
test_reduce_custom_acc_dtype
(
self
):
# Test the ability to provide your own accumulator dtype for a reduce.
# We try multiple axis combinations even though axis should not matter.
idx
=
0
for
method
in
self
.
methods
:
...
...
@@ -928,9 +931,8 @@ class T_reduce_dtype(unittest.TestCase):
class
T_mean_dtype
(
unittest
.
TestCase
):
def
test_mean_default_dtype
(
self
):
"""
Test the default dtype of a mean().
"""
# Test the default dtype of a mean().
# We try multiple axis combinations even though axis should not matter.
axes
=
[
None
,
0
,
1
,
[],
[
0
],
[
1
],
[
0
,
1
]]
for
idx
,
dtype
in
enumerate
(
imap
(
str
,
theano
.
scalar
.
all_types
)):
...
...
@@ -948,9 +950,8 @@ class T_mean_dtype(unittest.TestCase):
@attr
(
'slow'
)
def
test_mean_custom_dtype
(
self
):
"""
Test the ability to provide your own output dtype for a mean.
"""
# Test the ability to provide your own output dtype for a mean.
# We try multiple axis combinations even though axis should not matter.
axes
=
[
None
,
0
,
1
,
[],
[
0
],
[
1
],
[
0
,
1
]]
idx
=
0
...
...
@@ -1007,9 +1008,8 @@ class T_mean_dtype(unittest.TestCase):
class
T_prod_without_zeros_dtype
(
unittest
.
TestCase
):
def
test_prod_without_zeros_default_dtype
(
self
):
"""
Test the default dtype of a ProdWithoutZeros().
"""
# Test the default dtype of a ProdWithoutZeros().
# We try multiple axis combinations even though axis should not matter.
axes
=
[
None
,
0
,
1
,
[],
[
0
],
[
1
],
[
0
,
1
]]
for
idx
,
dtype
in
enumerate
(
imap
(
str
,
theano
.
scalar
.
all_types
)):
...
...
@@ -1025,9 +1025,8 @@ class T_prod_without_zeros_dtype(unittest.TestCase):
)
.
get
(
dtype
,
dtype
)
def
test_prod_without_zeros_default_acc_dtype
(
self
):
"""
Test the default dtype of a ProdWithoutZeros().
"""
# Test the default dtype of a ProdWithoutZeros().
# We try multiple axis combinations even though axis should not matter.
axes
=
[
None
,
0
,
1
,
[],
[
0
],
[
1
],
[
0
,
1
]]
for
idx
,
dtype
in
enumerate
(
imap
(
str
,
theano
.
scalar
.
all_types
)):
...
...
@@ -1055,9 +1054,8 @@ class T_prod_without_zeros_dtype(unittest.TestCase):
@attr
(
'slow'
)
def
test_prod_without_zeros_custom_dtype
(
self
):
"""
Test ability to provide your own output dtype for a ProdWithoutZeros().
"""
# Test ability to provide your own output dtype for a ProdWithoutZeros().
# We try multiple axis combinations even though axis should not matter.
axes
=
[
None
,
0
,
1
,
[],
[
0
],
[
1
],
[
0
,
1
]]
idx
=
0
...
...
@@ -1079,9 +1077,8 @@ class T_prod_without_zeros_dtype(unittest.TestCase):
@attr
(
'slow'
)
def
test_prod_without_zeros_custom_acc_dtype
(
self
):
"""
Test ability to provide your own acc_dtype for a ProdWithoutZeros().
"""
# Test ability to provide your own acc_dtype for a ProdWithoutZeros().
# We try multiple axis combinations even though axis should not matter.
axes
=
[
None
,
0
,
1
,
[],
[
0
],
[
1
],
[
0
,
1
]]
idx
=
0
...
...
theano/tensor/type.py
浏览文件 @
f0a58c50
...
...
@@ -341,7 +341,7 @@ class TensorType(Type):
return
False
if
a
.
dtype
!=
b
.
dtype
:
return
False
if
'float'
not
in
str
(
a
.
dtype
)
:
if
str
(
a
.
dtype
)
not
in
theano
.
tensor
.
continuous_dtypes
:
return
numpy
.
all
(
a
==
b
)
else
:
cmp
=
theano
.
tensor
.
basic
.
_allclose
(
a
,
b
,
rtol
=
rtol
,
atol
=
atol
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论