Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
96b7c725
提交
96b7c725
authored
7月 31, 2012
作者:
nouiz
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #805 from lamblin/fix_py24
Fixes for python 2.4
上级
ee51be36
ec9470ce
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
5 行增加
和
5 行删除
+5
-5
test_basic.py
theano/sparse/tests/test_basic.py
+3
-3
test_elemwise.py
theano/tensor/tests/test_elemwise.py
+2
-2
没有找到文件。
theano/sparse/tests/test_basic.py
浏览文件 @
96b7c725
...
@@ -1468,13 +1468,13 @@ class SpSumTester(utt.InferShapeTester):
...
@@ -1468,13 +1468,13 @@ class SpSumTester(utt.InferShapeTester):
variable
,
data
=
sparse_random_inputs
(
format
,
variable
,
data
=
sparse_random_inputs
(
format
,
shape
=
(
10
,
10
))
shape
=
(
10
,
10
))
z
=
theano
.
sparse
.
sp_sum
(
*
variable
,
axis
=
axis
)
z
=
theano
.
sparse
.
sp_sum
(
variable
[
0
]
,
axis
=
axis
)
if
axis
==
None
:
if
axis
==
None
:
assert
z
.
type
.
broadcastable
==
()
assert
z
.
type
.
broadcastable
==
()
else
:
else
:
assert
z
.
type
.
broadcastable
==
(
False
,
)
assert
z
.
type
.
broadcastable
==
(
False
,
)
f
=
theano
.
function
(
variable
,
self
.
op
(
*
variable
,
axis
=
axis
))
f
=
theano
.
function
(
variable
,
self
.
op
(
variable
[
0
]
,
axis
=
axis
))
tested
=
f
(
*
data
)
tested
=
f
(
*
data
)
expected
=
data
[
0
]
.
todense
()
.
sum
(
axis
)
.
ravel
()
expected
=
data
[
0
]
.
todense
()
.
sum
(
axis
)
.
ravel
()
assert
numpy
.
allclose
(
tested
,
expected
)
assert
numpy
.
allclose
(
tested
,
expected
)
...
@@ -1485,7 +1485,7 @@ class SpSumTester(utt.InferShapeTester):
...
@@ -1485,7 +1485,7 @@ class SpSumTester(utt.InferShapeTester):
variable
,
data
=
sparse_random_inputs
(
format
,
variable
,
data
=
sparse_random_inputs
(
format
,
shape
=
(
10
,
10
))
shape
=
(
10
,
10
))
self
.
_compile_and_check
(
variable
,
self
.
_compile_and_check
(
variable
,
[
self
.
op
(
*
variable
,
axis
=
axis
)],
[
self
.
op
(
variable
[
0
]
,
axis
=
axis
)],
data
,
data
,
self
.
op_class
)
self
.
op_class
)
...
...
theano/tensor/tests/test_elemwise.py
浏览文件 @
96b7c725
...
@@ -8,7 +8,7 @@ import numpy
...
@@ -8,7 +8,7 @@ import numpy
from
numpy.testing
import
dec
from
numpy.testing
import
dec
import
theano
import
theano
from
theano.gof.python25
import
all
from
theano.gof.python25
import
all
,
any
from
theano.gof
import
Variable
,
Op
from
theano.gof
import
Variable
,
Op
from
theano
import
gof
,
scalar
,
config
from
theano
import
gof
,
scalar
,
config
...
@@ -673,7 +673,7 @@ class T_mean_dtype(unittest.TestCase):
...
@@ -673,7 +673,7 @@ class T_mean_dtype(unittest.TestCase):
if
sum_dtype
in
tensor
.
discrete_dtypes
:
if
sum_dtype
in
tensor
.
discrete_dtypes
:
assert
mean_var
.
dtype
==
'float64'
,
(
mean_var
.
dtype
,
sum_dtype
)
assert
mean_var
.
dtype
==
'float64'
,
(
mean_var
.
dtype
,
sum_dtype
)
else
:
else
:
assert
mean_var
.
dtype
==
sum_dtype
,
(
mean_var
.
dtype
,
output
_dtype
)
assert
mean_var
.
dtype
==
sum_dtype
,
(
mean_var
.
dtype
,
sum
_dtype
)
# Check that we can take the gradient, when implemented
# Check that we can take the gradient, when implemented
try
:
try
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论