Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
659c98b6
提交
659c98b6
authored
6月 21, 2012
作者:
Nicolas Bouchard
提交者:
Frederic
7月 06, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pep8
上级
2a28db96
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
33 行删除
+14
-33
sp2.py
theano/sparse/sandbox/sp2.py
+14
-33
没有找到文件。
theano/sparse/sandbox/sp2.py
浏览文件 @
659c98b6
...
@@ -58,39 +58,14 @@ class Cast(gof.op.Op):
...
@@ -58,39 +58,14 @@ class Cast(gof.op.Op):
def
__str__
(
self
):
def
__str__
(
self
):
return
"
%
s(
%
s)"
%
(
self
.
__class__
.
__name__
,
self
.
out_type
)
return
"
%
s(
%
s)"
%
(
self
.
__class__
.
__name__
,
self
.
out_type
)
bcast
=
Cast
(
'int8'
)
def
cast
(
x
,
t
):
wcast
=
Cast
(
'int16'
)
"""Cast sparse variable `x` to the desired dtype `t`.
icast
=
Cast
(
'int32'
)
lcast
=
Cast
(
'int64'
)
This wrap the method astype from scipy.
fcast
=
Cast
(
'float32'
)
dcast
=
Cast
(
'float64'
)
:Parameters:
ccast
=
Cast
(
'complex64'
)
- `x`: Sparse array
zcast
=
Cast
(
'complex128'
)
- `t`: dtype
"""
return
Cast
(
t
)(
x
)
def
fcast
(
x
):
"""Cast sparse variable `x` to `float32`.
This wrap the method astype from scipy.
:Parameters:
- `x`: Sparse array
"""
return
Cast
(
'float32'
)(
x
)
def
dcast
(
x
):
"""Cast sparse variable `x` to `float64`.
This wrap the method astype from scipy.
:Parameters:
- `x`: Sparse array
"""
return
Cast
(
'float64'
)(
x
)
class
HStack
(
gof
.
op
.
Op
):
class
HStack
(
gof
.
op
.
Op
):
...
@@ -676,18 +651,21 @@ def structured_sigmoid(x):
...
@@ -676,18 +651,21 @@ def structured_sigmoid(x):
"""
"""
# see decorator for function body
# see decorator for function body
@structured_monoid
(
tensor
.
exp
)
@structured_monoid
(
tensor
.
exp
)
def
structured_exp
(
x
):
def
structured_exp
(
x
):
"""structured elemwise exponential.
"""structured elemwise exponential.
"""
"""
# see decorator for function body
# see decorator for function body
@structured_monoid
(
tensor
.
log
)
@structured_monoid
(
tensor
.
log
)
def
structured_log
(
x
):
def
structured_log
(
x
):
"""structured elemwise logarithm.
"""structured elemwise logarithm.
"""
"""
# see decorator for function body
# see decorator for function body
@structured_monoid
(
tensor
.
pow
)
@structured_monoid
(
tensor
.
pow
)
def
structured_pow
(
x
,
y
):
def
structured_pow
(
x
,
y
):
"""structured elemwise power of sparse matrix
"""structured elemwise power of sparse matrix
...
@@ -695,6 +673,7 @@ def structured_pow(x, y):
...
@@ -695,6 +673,7 @@ def structured_pow(x, y):
"""
"""
# see decorator for function body
# see decorator for function body
@structured_monoid
(
tensor
.
minimum
)
@structured_monoid
(
tensor
.
minimum
)
def
structured_minimum
(
x
,
y
):
def
structured_minimum
(
x
,
y
):
"""structured elemwise minimum of sparse matrix
"""structured elemwise minimum of sparse matrix
...
@@ -702,6 +681,7 @@ def structured_minimum(x, y):
...
@@ -702,6 +681,7 @@ def structured_minimum(x, y):
"""
"""
# see decorator for function body
# see decorator for function body
@structured_monoid
(
tensor
.
maximum
)
@structured_monoid
(
tensor
.
maximum
)
def
structured_maximum
(
x
,
y
):
def
structured_maximum
(
x
,
y
):
"""structured elemwise maximum of sparse matrix
"""structured elemwise maximum of sparse matrix
...
@@ -709,6 +689,7 @@ def structured_maximum(x, y):
...
@@ -709,6 +689,7 @@ def structured_maximum(x, y):
"""
"""
# see decorator for function body
# see decorator for function body
@structured_monoid
(
tensor
.
add
)
@structured_monoid
(
tensor
.
add
)
def
structured_add
(
x
):
def
structured_add
(
x
):
"""structured addition of sparse matrix
"""structured addition of sparse matrix
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论