Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
96ce7bd7
提交
96ce7bd7
authored
10月 21, 2020
作者:
Brandon T. Willard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Apply isort to theano.sparse sub-package modules
上级
c0b324fa
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
81 行增加
和
79 行删除
+81
-79
__init__.py
theano/sparse/__init__.py
+3
-2
basic.py
theano/sparse/basic.py
+5
-6
opt.py
theano/sparse/opt.py
+8
-8
sp.py
theano/sparse/sandbox/sp.py
+1
-2
sp2.py
theano/sparse/sandbox/sp2.py
+58
-59
sharedvar.py
theano/sparse/sharedvar.py
+3
-1
type.py
theano/sparse/type.py
+3
-1
没有找到文件。
theano/sparse/__init__.py
浏览文件 @
96ce7bd7
import
sys
import
sys
try
:
try
:
import
scipy
import
scipy
...
@@ -19,8 +20,8 @@ except ImportError:
...
@@ -19,8 +20,8 @@ except ImportError:
from
theano.sparse.type
import
*
from
theano.sparse.type
import
*
if
enable_sparse
:
if
enable_sparse
:
from
theano.sparse
import
opt
,
sharedvar
from
theano.sparse.basic
import
*
from
theano.sparse.basic
import
*
from
theano.sparse
import
opt
from
theano.sparse
import
sharedvar
from
theano.sparse.sharedvar
import
sparse_constructor
as
shared
from
theano.sparse.sharedvar
import
sparse_constructor
as
shared
theano/sparse/basic.py
浏览文件 @
96ce7bd7
...
@@ -13,17 +13,16 @@ http://www-users.cs.umn.edu/~saad/software/SPARSKIT/paper.ps
...
@@ -13,17 +13,16 @@ http://www-users.cs.umn.edu/~saad/software/SPARSKIT/paper.ps
import
sys
import
sys
import
numpy
as
np
import
numpy
as
np
import
scipy.sparse
from
numpy.lib.stride_tricks
import
as_strided
from
numpy.lib.stride_tricks
import
as_strided
from
six
import
integer_types
from
six
import
integer_types
import
scipy.sparse
import
theano
import
theano
from
theano
import
gof
,
tensor
,
scalar
,
config
from
theano
import
config
,
gof
,
scalar
,
tensor
from
theano.gradient
import
DisconnectedType
from
theano.gradient
import
DisconnectedType
,
grad_not_implemented
,
grad_undefined
from
theano.sparse.utils
import
hash_from_sparse
from
theano.gradient
import
grad_not_implemented
,
grad_undefined
from
theano.sparse.type
import
SparseType
,
_is_sparse
from
theano.sparse.type
import
SparseType
,
_is_sparse
from
theano.sparse.utils
import
hash_from_sparse
sparse_formats
=
[
"csc"
,
"csr"
]
sparse_formats
=
[
"csc"
,
"csr"
]
...
...
theano/sparse/opt.py
浏览文件 @
96ce7bd7
...
@@ -3,20 +3,20 @@ import scipy
...
@@ -3,20 +3,20 @@ import scipy
import
theano
import
theano
from
theano
import
gof
,
scalar
,
tensor
from
theano
import
gof
,
scalar
,
tensor
from
theano.sparse
import
basic
as
sparse
from
theano.tensor
import
blas
from
theano.sparse.basic
import
(
from
theano.tensor.opt
import
register_specialize
,
register_canonicalize
from
theano.sparse
import
(
CSC
,
CSC
,
CSR
,
CSR
,
csm_
properties
,
csm_
data
,
csm_grad
,
csm_grad
,
usmm
,
csm_indices
,
csm_indices
,
csm_indptr
,
csm_indptr
,
csm_data
,
csm_properties
,
usmm
,
)
)
from
theano.sparse
import
basic
as
sparse
from
theano.tensor
import
blas
from
theano.tensor.opt
import
register_canonicalize
,
register_specialize
_is_sparse_variable
=
sparse
.
_is_sparse_variable
_is_sparse_variable
=
sparse
.
_is_sparse_variable
_is_dense
=
sparse
.
_is_dense
_is_dense
=
sparse
.
_is_dense
...
...
theano/sparse/sandbox/sp.py
浏览文件 @
96ce7bd7
...
@@ -11,10 +11,9 @@ U{http://www-users.cs.umn.edu/~saad/software/SPARSKIT/paper.ps}.
...
@@ -11,10 +11,9 @@ U{http://www-users.cs.umn.edu/~saad/software/SPARSKIT/paper.ps}.
import
numpy
as
np
import
numpy
as
np
from
scipy
import
sparse
as
scipy_sparse
from
scipy
import
sparse
as
scipy_sparse
import
theano
import
theano
import
theano.sparse
import
theano.sparse
from
theano
import
sparse
,
Op
,
tensor
from
theano
import
Op
,
sparse
,
tensor
def
register_specialize
(
lopt
,
*
tags
,
**
kwargs
):
def
register_specialize
(
lopt
,
*
tags
,
**
kwargs
):
...
...
theano/sparse/sandbox/sp2.py
浏览文件 @
96ce7bd7
import
numpy
as
np
import
numpy
as
np
import
theano
import
scipy.sparse
import
scipy.sparse
import
theano
from
theano
import
gof
,
tensor
from
theano
import
gof
,
tensor
from
theano.tensor
import
discrete_dtypes
,
float_dtypes
from
theano.sparse.basic
import
(
# To maintain compatibility
from
theano.tensor.opt
import
register_specialize
from
theano.sparse.basic
import
(
as_sparse_variable
,
SparseType
,
add_s_s
,
neg
,
mul_s_s
,
mul_s_d
,
dot
,
CSMProperties
,
CSM
,
_is_sparse_variable
,
_is_dense_variable
,
CSC
,
CSC
,
CSM
,
CSR
,
CSR
,
csm_properties
,
AddSSData
,
Cast
,
CSMProperties
,
HStack
,
MulSV
,
Remove0
,
SamplingDot
,
SparseType
,
StructuredAddSV
,
VStack
,
_is_dense_variable
,
_is_sparse
,
_is_sparse_variable
,
add_s_s
,
add_s_s_data
,
as_sparse_variable
,
bcast
,
ccast
,
csm_data
,
csm_data
,
csm_indices
,
csm_indices
,
csm_indptr
,
csm_indptr
,
csm_properties
,
csm_shape
,
csm_shape
,
_is_sparse
,
# To maintain compatibility
Remove0
,
remove0
,
Cast
,
bcast
,
wcast
,
icast
,
lcast
,
fcast
,
dcast
,
dcast
,
ccast
,
dot
,
zcast
,
fcast
,
HStack
,
hstack
,
hstack
,
VStack
,
icast
,
vstack
,
lcast
,
AddSSData
,
mul_s_d
,
add_s_s_data
,
mul_s_s
,
MulSV
,
mul_s_v
,
mul_s_v
,
structured_monoid
,
neg
,
structured_sigmoid
,
remove0
,
sampling_dot
,
structured_add
,
structured_add_s_v
,
structured_exp
,
structured_exp
,
structured_log
,
structured_log
,
structured_pow
,
structured_minimum
,
structured_maximum
,
structured_maximum
,
structured_add
,
structured_minimum
,
StructuredAddSV
,
structured_monoid
,
structured_add_s_v
,
structured_pow
,
SamplingDot
,
structured_sigmoid
,
sampling_dot
,
vstack
,
wcast
,
zcast
,
)
)
# Probability Ops are currently back in sandbox, because they do not respect
# Theano's Op contract, as their behaviour is not reproducible: calling
# the perform() method twice with the same argument will yield different
# results.
# from theano.sparse.basic import (
# Multinomial, multinomial, Poisson, poisson,
# Binomial, csr_fbinomial, csc_fbinomial, csr_dbinomial, csc_dbinomial)
# Also for compatibility
# Also for compatibility
from
theano.sparse.opt
import
(
from
theano.sparse.opt
import
(
MulSDCSC
,
MulSDCSC
,
mul_s_d_csc
,
MulSDCSR
,
MulSDCSR
,
mul_s_d_csr
,
MulSVCSR
,
MulSVCSR
,
mul_s_v_csr
,
StructuredAddSVCSR
,
structured_add_s_v_csr
,
SamplingDotCSR
,
SamplingDotCSR
,
sampling_dot_csr
,
StructuredAddSVCSR
,
local_mul_s_d
,
local_mul_s_d
,
local_mul_s_v
,
local_mul_s_v
,
local_structured_add_s_v
,
local_sampling_dot_csr
,
local_sampling_dot_csr
,
local_structured_add_s_v
,
mul_s_d_csc
,
mul_s_d_csr
,
mul_s_v_csr
,
sampling_dot_csr
,
structured_add_s_v_csr
,
)
)
from
theano.tensor
import
discrete_dtypes
,
float_dtypes
from
theano.tensor.opt
import
register_specialize
# Probability Ops are currently back in sandbox, because they do not respect
# Theano's Op contract, as their behaviour is not reproducible: calling
# the perform() method twice with the same argument will yield different
# results.
# from theano.sparse.basic import (
# Multinomial, multinomial, Poisson, poisson,
# Binomial, csr_fbinomial, csc_fbinomial, csr_dbinomial, csc_dbinomial)
# Alias to maintain compatibility
# Alias to maintain compatibility
...
...
theano/sparse/sharedvar.py
浏览文件 @
96ce7bd7
import
copy
import
copy
import
scipy.sparse
import
scipy.sparse
from
theano.compile
import
shared_constructor
,
SharedVariable
from
theano.compile
import
SharedVariable
,
shared_constructor
from
theano.sparse.basic
import
SparseType
,
_sparse_py_operators
from
theano.sparse.basic
import
SparseType
,
_sparse_py_operators
...
...
theano/sparse/type.py
浏览文件 @
96ce7bd7
import
numpy
as
np
import
numpy
as
np
try
:
try
:
import
scipy.sparse
import
scipy.sparse
...
@@ -7,9 +8,10 @@ try:
...
@@ -7,9 +8,10 @@ try:
except
ImportError
:
except
ImportError
:
imported_scipy
=
False
imported_scipy
=
False
from
six
import
string_types
import
theano
import
theano
from
theano
import
gof
from
theano
import
gof
from
six
import
string_types
def
_is_sparse
(
x
):
def
_is_sparse
(
x
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论