Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c5baab47
提交
c5baab47
authored
8月 06, 2012
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
small test fix when scipy is not available.
上级
0b6e8f30
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
22 行增加
和
9 行删除
+22
-9
pfunc.py
theano/compile/pfunc.py
+15
-7
test_kron.py
theano/sandbox/linalg/tests/test_kron.py
+5
-2
test_opt.py
theano/sparse/tests/test_opt.py
+1
-0
test_utils.py
theano/sparse/tests/test_utils.py
+1
-0
没有找到文件。
theano/compile/pfunc.py
浏览文件 @
c5baab47
...
...
@@ -198,17 +198,25 @@ def rebuild_collect_shared(outputs,
(
store_into
,
update_d
[
store_into
]))
# filter_variable ensure smooth conversion of cpu/gpu Types
try
:
update_val
=
store_into
.
type
.
filter_variable
(
update_val
)
if
update_val
.
type
!=
store_into
.
type
:
err_msg
=
(
'an update must have the same type as the '
'original shared variable(dest, dest.type, '
'update_val, update_val.type)'
)
err_arg
=
(
store_into
,
except
TypeError
,
e
:
err_msg
=
(
'An update must have the same type as the'
' original shared variable (shared_var=
%
s,'
' shared_var.type=
%
s,'
' update_val=
%
s, update_val.type=
%
s).'
%
(
store_into
,
store_into
.
type
,
update_val
,
update_val
.
type
)
update_val
.
type
))
err_sug
=
(
'If the difference is related to the broadcast pattern,'
' you can call the'
' tensor.unbroadcast(var, axis_to_unbroadcast[, ...])'
' function to remove broadcastable dimensions.'
)
raise
TypeError
(
err_msg
,
err_sug
)
assert
update_val
.
type
==
store_into
.
type
raise
TypeError
(
err_msg
,
err_arg
)
update_d
[
store_into
]
=
update_val
update_expr
.
append
((
store_into
,
update_val
))
...
...
theano/sandbox/linalg/tests/test_kron.py
浏览文件 @
c5baab47
from
nose.plugins.skip
import
SkipTest
import
numpy
from
theano
import
tensor
,
function
from
theano.tests
import
unittest_tools
as
utt
from
theano.sandbox.linalg.kron
import
Kron
,
kron
...
...
@@ -9,6 +11,9 @@ try:
except
ImportError
:
imported_scipy
=
False
if
not
imported_scipy
:
raise
SkipTest
(
'Kron Op need the scipy package to be installed'
)
class
TestKron
(
utt
.
InferShapeTester
):
...
...
@@ -20,8 +25,6 @@ class TestKron(utt.InferShapeTester):
self
.
op
=
kron
def
test_perform
(
self
):
assert
imported_scipy
,
(
"Scipy not available. Scipy is needed for TestKron"
)
x
=
tensor
.
dmatrix
()
y
=
tensor
.
dmatrix
()
f
=
function
([
x
,
y
],
kron
(
x
,
y
))
...
...
theano/sparse/tests/test_opt.py
浏览文件 @
c5baab47
from
nose.plugins.skip
import
SkipTest
import
numpy
try
:
import
scipy.sparse
as
sp
...
...
theano/sparse/tests/test_utils.py
浏览文件 @
c5baab47
from
nose.plugins.skip
import
SkipTest
import
numpy
import
theano.sparse
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论