Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
640b1f52
提交
640b1f52
authored
1月 22, 2014
作者:
abergeron
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1704 from nouiz/scipy_ger
Fix ScipyGer crash
上级
ae3c3c7b
ff81bd19
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
32 行增加
和
16 行删除
+32
-16
check_blas.py
theano/misc/check_blas.py
+3
-1
blas.py
theano/tensor/blas.py
+16
-10
blas_scipy.py
theano/tensor/blas_scipy.py
+10
-4
test_elemwise.py
theano/tensor/tests/test_elemwise.py
+3
-1
没有找到文件。
theano/misc/check_blas.py
浏览文件 @
640b1f52
...
@@ -205,9 +205,11 @@ if __name__ == "__main__":
...
@@ -205,9 +205,11 @@ if __name__ == "__main__":
gpu
gpu
K20m/ECC 0.07s
K20m/ECC 0.07s
K20/NOECC 0.07s
K20/NOECC 0.07s
C2075 0.25s
M2075 0.25s
M2070 0.25s 0.27s 0.32s
M2070 0.25s 0.27s 0.32s
M2070-Q 0.48s 0.27s 0.32s
M2050(Amazon) 0.25s
M2050(Amazon) 0.25s
C2075 0.25s
C1060 0.46s
C1060 0.46s
GTX Titan(D15U-50)0.06s 0.06s don't work
GTX Titan(D15U-50)0.06s 0.06s don't work
...
...
theano/tensor/blas.py
浏览文件 @
640b1f52
...
@@ -261,16 +261,22 @@ SOMEPATH/Canopy_64bit/User/lib/python2.7/site-packages/numpy/distutils/system_in
...
@@ -261,16 +261,22 @@ SOMEPATH/Canopy_64bit/User/lib/python2.7/site-packages/numpy/distutils/system_in
#if numpy was linked with library that are not installed, we
#if numpy was linked with library that are not installed, we
#can't reuse them.
#can't reuse them.
if
any
(
os
.
path
.
exists
(
dir
)
for
dir
in
blas_info
[
'library_dirs'
]):
if
any
(
os
.
path
.
exists
(
dir
)
for
dir
in
blas_info
[
'library_dirs'
]):
return
' '
.
join
(
ret
=
(
#TODO: the Gemm op below should separate the
#TODO: the Gemm op below should separate the
# -L and -l arguments into the two callbacks
# -L and -l arguments into the two callbacks
# that CLinker uses for that stuff. for now,
# that CLinker uses for that stuff. for now,
# we just pass the whole ldflags as the -l
# we just pass the whole ldflags as the -l
# options part.
# options part.
[
'-L
%
s'
%
l
for
l
in
blas_info
[
'library_dirs'
]]
+
[
'-L
%
s'
%
l
for
l
in
blas_info
[
'library_dirs'
]]
+
[
'-l
%
s'
%
l
for
l
in
blas_info
[
'libraries'
]]
+
[
'-l
%
s'
%
l
for
l
in
blas_info
[
'libraries'
]]
+
[])
[])
# ['-I%s' % l for l in blas_info['include_dirs']])
# ['-I%s' % l for l in blas_info['include_dirs']])
#if numpy was linked with library that are not installed or
#the dev version of the package is not currently available, we
#can't reuse them.
if
GCC_compiler
.
try_flags
(
ret
):
return
' '
.
join
(
ret
)
except
KeyError
:
except
KeyError
:
pass
pass
...
...
theano/tensor/blas_scipy.py
浏览文件 @
640b1f52
...
@@ -26,6 +26,7 @@ class ScipyGer(Ger):
...
@@ -26,6 +26,7 @@ class ScipyGer(Ger):
node_input_storage
=
[
storage_map
[
r
]
for
r
in
node
.
inputs
]
node_input_storage
=
[
storage_map
[
r
]
for
r
in
node
.
inputs
]
node_output_storage
=
[
storage_map
[
r
]
for
r
in
node
.
outputs
]
node_output_storage
=
[
storage_map
[
r
]
for
r
in
node
.
outputs
]
node_output_compute
=
[
compute_map
[
r
]
for
r
in
node
.
outputs
]
# get vars for containers
# get vars for containers
cA
,
calpha
,
cx
,
cy
=
node_input_storage
cA
,
calpha
,
cx
,
cy
=
node_input_storage
...
@@ -51,6 +52,8 @@ class ScipyGer(Ger):
...
@@ -51,6 +52,8 @@ class ScipyGer(Ger):
A
=
local_ger
(
calpha
[
0
],
cx
[
0
],
cy
[
0
],
a
=
A
,
A
=
local_ger
(
calpha
[
0
],
cx
[
0
],
cy
[
0
],
a
=
A
,
overwrite_a
=
int
(
self
.
destructive
))
overwrite_a
=
int
(
self
.
destructive
))
cZ
[
0
]
=
A
cZ
[
0
]
=
A
for
o
in
node_output_compute
:
o
[
0
]
=
True
#TODO: If this is currently an unofficial part of the thunk API,
#TODO: If this is currently an unofficial part of the thunk API,
# then maybe it should be documented and made official?
# then maybe it should be documented and made official?
...
@@ -59,15 +62,18 @@ class ScipyGer(Ger):
...
@@ -59,15 +62,18 @@ class ScipyGer(Ger):
rval
.
lazy
=
False
rval
.
lazy
=
False
return
rval
return
rval
scipy_ger_no_inplace
=
ScipyGer
(
False
)
scipy_ger_inplace
=
ScipyGer
(
True
)
@local_optimizer
([
ger
,
ger_destructive
])
@local_optimizer
([
ger
,
ger_destructive
])
def
use_scipy_ger
(
node
):
def
use_scipy_ger
(
node
):
if
node
.
op
==
ger
:
if
node
.
op
==
ger
:
return
[
ScipyGer
(
False
)
(
*
node
.
inputs
)]
return
[
scipy_ger_no_inplace
(
*
node
.
inputs
)]
@local_optimizer
([
ScipyGer
(
False
)
])
@local_optimizer
([
scipy_ger_no_inplace
])
def
make_ger_destructive
(
node
):
def
make_ger_destructive
(
node
):
if
node
.
op
==
ScipyGer
(
False
)
:
if
node
.
op
==
scipy_ger_no_inplace
:
return
[
ScipyGer
(
True
)
(
*
node
.
inputs
)]
return
[
scipy_ger_inplace
(
*
node
.
inputs
)]
use_scipy_blas
=
in2out
(
use_scipy_ger
)
use_scipy_blas
=
in2out
(
use_scipy_ger
)
make_scipy_blas_destructive
=
in2out
(
make_ger_destructive
)
make_scipy_blas_destructive
=
in2out
(
make_ger_destructive
)
...
...
theano/tensor/tests/test_elemwise.py
浏览文件 @
640b1f52
...
@@ -697,7 +697,9 @@ class test_IsInf_IsNan(unittest.TestCase):
...
@@ -697,7 +697,9 @@ class test_IsInf_IsNan(unittest.TestCase):
(
x
.
ndim
==
1
and
input
is
not
self
.
vector
)):
(
x
.
ndim
==
1
and
input
is
not
self
.
vector
)):
# We only test with the appropriate input type.
# We only test with the appropriate input type.
continue
continue
assert
(
theano_isfunc
(
x
)
==
numpy_isfunc
(
x
))
.
all
()
t_out
=
theano_isfunc
(
x
)
n_out
=
numpy_isfunc
(
x
)
assert
(
t_out
==
n_out
)
.
all
(),
(
t_out
,
n_out
)
def
test_isinf
(
self
):
def
test_isinf
(
self
):
return
self
.
run_isfunc
(
'isinf'
)
return
self
.
run_isfunc
(
'isinf'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论