Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
58b0847e
提交
58b0847e
authored
7月 17, 2015
作者:
Iban Harlouchet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Whitespaces removed to theano/sparse/basic.py
上级
29abb700
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
9 行增加
和
7 行删除
+9
-7
basic.py
theano/sparse/basic.py
+9
-7
没有找到文件。
theano/sparse/basic.py
浏览文件 @
58b0847e
...
@@ -823,7 +823,7 @@ csm_grad = CSMGrad
...
@@ -823,7 +823,7 @@ csm_grad = CSMGrad
class
Cast
(
gof
.
op
.
Op
):
class
Cast
(
gof
.
op
.
Op
):
# See doc in instance of this Op or function after this class definition.
# See doc in instance of this Op or function after this class definition.
__props__
=
(
"out_type"
,)
__props__
=
(
"out_type"
,)
def
__init__
(
self
,
out_type
):
def
__init__
(
self
,
out_type
):
self
.
out_type
=
out_type
self
.
out_type
=
out_type
...
@@ -897,7 +897,7 @@ def cast(variable, dtype):
...
@@ -897,7 +897,7 @@ def cast(variable, dtype):
class
DenseFromSparse
(
gof
.
op
.
Op
):
class
DenseFromSparse
(
gof
.
op
.
Op
):
# See doc in instance of this Op or function after this class definition.
# See doc in instance of this Op or function after this class definition.
__props__
=
()
# We don't put sparse_grad in the props.
__props__
=
()
# We don't put sparse_grad in the props.
def
__init__
(
self
,
structured
=
True
):
def
__init__
(
self
,
structured
=
True
):
self
.
sparse_grad
=
structured
self
.
sparse_grad
=
structured
...
@@ -1584,7 +1584,7 @@ def row_scale(x, s):
...
@@ -1584,7 +1584,7 @@ def row_scale(x, s):
class
SpSum
(
gof
.
op
.
Op
):
class
SpSum
(
gof
.
op
.
Op
):
# See doc in instance of this Op or function after this class definition.
# See doc in instance of this Op or function after this class definition.
__props__
=
(
"axis"
,)
__props__
=
(
"axis"
,)
# WARNING: judgement call...
# WARNING: judgement call...
# We are not using the structured in the comparison or hashing
# We are not using the structured in the comparison or hashing
...
@@ -2352,7 +2352,7 @@ class __ComparisonOpSD(gof.op.Op):
...
@@ -2352,7 +2352,7 @@ class __ComparisonOpSD(gof.op.Op):
:return: Comparison(x,y)
:return: Comparison(x,y)
"""
"""
__props__
=
()
__props__
=
()
# Function to override
# Function to override
def
comparison
(
self
,
x
,
y
):
def
comparison
(
self
,
x
,
y
):
raise
NotImplementedError
()
raise
NotImplementedError
()
...
@@ -2377,6 +2377,7 @@ class __ComparisonOpSD(gof.op.Op):
...
@@ -2377,6 +2377,7 @@ class __ComparisonOpSD(gof.op.Op):
def
infer_shape
(
self
,
node
,
ins_shapes
):
def
infer_shape
(
self
,
node
,
ins_shapes
):
return
[
ins_shapes
[
0
]]
return
[
ins_shapes
[
0
]]
def
__ComparisonSwitch
(
SS
,
SD
,
DS
):
def
__ComparisonSwitch
(
SS
,
SD
,
DS
):
"""
"""
:param SS: function to apply between two sparses matrices.
:param SS: function to apply between two sparses matrices.
...
@@ -2573,7 +2574,7 @@ ge = __ComparisonSwitch(greater_equal_s_s, greater_equal_s_d,
...
@@ -2573,7 +2574,7 @@ ge = __ComparisonSwitch(greater_equal_s_s, greater_equal_s_d,
class
HStack
(
gof
.
op
.
Op
):
class
HStack
(
gof
.
op
.
Op
):
# See doc in instance of this Op or function after this class definition.
# See doc in instance of this Op or function after this class definition.
__props__
=
(
"format"
,
"dtype"
)
__props__
=
(
"format"
,
"dtype"
)
def
__init__
(
self
,
format
=
None
,
dtype
=
None
):
def
__init__
(
self
,
format
=
None
,
dtype
=
None
):
if
format
is
None
:
if
format
is
None
:
self
.
format
=
'csc'
self
.
format
=
'csc'
...
@@ -2733,7 +2734,7 @@ def vstack(blocks, format=None, dtype=None):
...
@@ -2733,7 +2734,7 @@ def vstack(blocks, format=None, dtype=None):
class
Remove0
(
gof
.
Op
):
class
Remove0
(
gof
.
Op
):
# See doc in instance of this Op or a function after the class definition.
# See doc in instance of this Op or a function after the class definition.
__props__
=
(
"inplace"
,)
__props__
=
(
"inplace"
,)
def
__init__
(
self
,
inplace
=
False
):
def
__init__
(
self
,
inplace
=
False
):
self
.
inplace
=
inplace
self
.
inplace
=
inplace
if
self
.
inplace
:
if
self
.
inplace
:
...
@@ -3005,7 +3006,7 @@ class TrueDot(gof.op.Op):
...
@@ -3005,7 +3006,7 @@ class TrueDot(gof.op.Op):
# TODO
# TODO
# Simplify code by splitting into DotSS and DotSD.
# Simplify code by splitting into DotSS and DotSD.
__props__
=
()
__props__
=
()
# The grad_preserves_dense attribute doesn't change the
# The grad_preserves_dense attribute doesn't change the
# execution behavior. To let the optimizer merge nodes with
# execution behavior. To let the optimizer merge nodes with
...
@@ -3089,6 +3090,7 @@ class TrueDot(gof.op.Op):
...
@@ -3089,6 +3090,7 @@ class TrueDot(gof.op.Op):
def
infer_shape
(
self
,
node
,
shapes
):
def
infer_shape
(
self
,
node
,
shapes
):
return
[(
shapes
[
0
][
0
],
shapes
[
1
][
1
])]
return
[(
shapes
[
0
][
0
],
shapes
[
1
][
1
])]
def
true_dot
(
x
,
y
,
grad_preserves_dense
=
True
):
def
true_dot
(
x
,
y
,
grad_preserves_dense
=
True
):
"""
"""
Operation for efficiently calculating the dot product when
Operation for efficiently calculating the dot product when
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论