Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0520f913
提交
0520f913
authored
11月 04, 2014
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
small code cleanup.
上级
c225b7a2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
9 行增加
和
15 行删除
+9
-15
basic.py
theano/sparse/basic.py
+0
-6
opt.py
theano/sparse/opt.py
+9
-9
没有找到文件。
theano/sparse/basic.py
浏览文件 @
0520f913
...
...
@@ -25,12 +25,6 @@ from theano.sparse.type import SparseType, _is_sparse
sparse_formats
=
[
'csc'
,
'csr'
]
# TODO: move this decorator to the compile submodule
def
register_specialize
(
lopt
,
*
tags
,
**
kwargs
):
compile
.
optdb
[
'specialize'
]
.
register
((
kwargs
and
kwargs
.
pop
(
'name'
))
or
lopt
.
__name__
,
lopt
,
'fast_run'
,
*
tags
)
""" Types of sparse matrices to use for testing """
_mtypes
=
[
scipy
.
sparse
.
csc_matrix
,
scipy
.
sparse
.
csr_matrix
]
#_mtypes = [sparse.csc_matrix, sparse.csr_matrix, sparse.dok_matrix,
...
...
theano/sparse/opt.py
浏览文件 @
0520f913
...
...
@@ -6,8 +6,8 @@ import scipy
import
theano
from
theano
import
gof
,
scalar
,
tensor
from
theano.tensor
import
blas
from
theano.tensor.opt
import
register_specialize
from
theano.sparse
import
(
CSC
,
CSR
,
csm_properties
,
register_specialize
,
csm_grad
,
usmm
,
csm_indices
,
csm_indptr
,
csm_data
)
from
theano.sparse
import
basic
as
sparse
...
...
@@ -29,7 +29,7 @@ def local_csm_properties_csm(node):
return
ret_var
return
False
sparse
.
register_specialize
(
local_csm_properties_csm
)
register_specialize
(
local_csm_properties_csm
)
# This is tested in tests/test_basic.py:test_remove0
...
...
@@ -861,7 +861,7 @@ def local_usmm_csx(node):
return
[
usmm_csc_dense
(
alpha
,
x_val
,
x_ind
,
x_ptr
,
x_nsparse
,
y
,
z
)]
return
False
sparse
.
register_specialize
(
local_usmm_csx
,
'cxx_only'
)
register_specialize
(
local_usmm_csx
,
'cxx_only'
)
class
CSMGradC
(
gof
.
Op
):
...
...
@@ -1272,7 +1272,7 @@ def local_mul_s_d(node):
sparse
.
csm_shape
(
svar
))]
return
False
sparse
.
register_specialize
(
local_mul_s_d
,
'cxx_only'
)
register_specialize
(
local_mul_s_d
,
'cxx_only'
)
class
MulSVCSR
(
gof
.
Op
):
...
...
@@ -1414,7 +1414,7 @@ def local_mul_s_v(node):
return
[
CSx
(
c_data
,
s_ind
,
s_ptr
,
s_shape
)]
return
False
sparse
.
register_specialize
(
local_mul_s_v
,
'cxx_only'
)
register_specialize
(
local_mul_s_v
,
'cxx_only'
)
class
StructuredAddSVCSR
(
gof
.
Op
):
...
...
@@ -1573,7 +1573,7 @@ def local_structured_add_s_v(node):
return
[
CSx
(
c_data
,
s_ind
,
s_ptr
,
s_shape
)]
return
False
sparse
.
register_specialize
(
local_structured_add_s_v
,
'cxx_only'
)
register_specialize
(
local_structured_add_s_v
,
'cxx_only'
)
class
SamplingDotCSR
(
gof
.
Op
):
...
...
@@ -1822,6 +1822,6 @@ def local_sampling_dot_csr(node):
return
[
sparse
.
CSR
(
z_data
,
z_ind
,
z_ptr
,
p_shape
)]
return
False
sparse
.
register_specialize
(
local_sampling_dot_csr
,
'cxx_only'
,
name
=
'local_sampling_dot_csr'
)
register_specialize
(
local_sampling_dot_csr
,
'cxx_only'
,
name
=
'local_sampling_dot_csr'
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论