Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
6319c6b4
提交
6319c6b4
authored
2月 10, 2016
作者:
Samira Shabanian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
set kmap to be None
上级
fa6a8eb4
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
10 行删除
+6
-10
basic.py
theano/sparse/basic.py
+6
-10
没有找到文件。
theano/sparse/basic.py
浏览文件 @
6319c6b4
...
@@ -527,7 +527,10 @@ class CSMProperties(gof.Op):
...
@@ -527,7 +527,10 @@ class CSMProperties(gof.Op):
"""
"""
def
__init__
(
self
,
kmap
=
None
):
def
__init__
(
self
,
kmap
=
None
):
self
.
kmap
=
kmap
if
kmap
==
None
:
self
.
kmap
=
kmap
else
:
raise
Exception
(
"Do not use kmap, it is removed"
)
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
return
type
(
self
)
==
type
(
other
)
and
_kmap_eq
(
self
.
kmap
,
other
.
kmap
)
return
type
(
self
)
==
type
(
other
)
and
_kmap_eq
(
self
.
kmap
,
other
.
kmap
)
...
@@ -553,8 +556,6 @@ class CSMProperties(gof.Op):
...
@@ -553,8 +556,6 @@ class CSMProperties(gof.Op):
(
csm
,)
=
inputs
(
csm
,)
=
inputs
if
self
.
kmap
is
None
:
if
self
.
kmap
is
None
:
out
[
0
][
0
]
=
csm
.
data
out
[
0
][
0
]
=
csm
.
data
else
:
warnings
.
warn
(
"Do not use kmap, it is removed"
)
if
str
(
csm
.
data
.
dtype
)
==
'int32'
:
if
str
(
csm
.
data
.
dtype
)
==
'int32'
:
out
[
0
][
0
]
=
theano
.
_asarray
(
out
[
0
][
0
],
dtype
=
'int32'
)
out
[
0
][
0
]
=
theano
.
_asarray
(
out
[
0
][
0
],
dtype
=
'int32'
)
# backport
# backport
...
@@ -661,8 +662,7 @@ class CSM(gof.Op):
...
@@ -661,8 +662,7 @@ class CSM(gof.Op):
kmap
=
None
kmap
=
None
self
.
kmap
=
kmap
self
.
kmap
=
kmap
if
self
.
kmap
is
not
None
:
if
self
.
kmap
is
not
None
:
warnings
.
warn
(
"Do not use kmap, it is removed"
)
raise
Exception
(
"Do not use kmap, it is removed"
)
if
not
isinstance
(
self
.
kmap
,
numpy
.
ndarray
):
if
not
isinstance
(
self
.
kmap
,
numpy
.
ndarray
):
# should view the other inputs too, but viewing multiple
# should view the other inputs too, but viewing multiple
# inputs is not currently supported by the destroyhandler
# inputs is not currently supported by the destroyhandler
...
@@ -679,8 +679,6 @@ class CSM(gof.Op):
...
@@ -679,8 +679,6 @@ class CSM(gof.Op):
return
self
.
_hashval
return
self
.
_hashval
def
__str__
(
self
):
def
__str__
(
self
):
if
self
.
kmap
is
not
None
:
warnings
.
warn
(
"Do not use kmap, it is removed"
)
return
self
.
__class__
.
__name__
return
self
.
__class__
.
__name__
def
make_node
(
self
,
data
,
indices
,
indptr
,
shape
):
def
make_node
(
self
,
data
,
indices
,
indptr
,
shape
):
...
@@ -727,8 +725,6 @@ class CSM(gof.Op):
...
@@ -727,8 +725,6 @@ class CSM(gof.Op):
# for efficiency, if remap does nothing, then do not apply it
# for efficiency, if remap does nothing, then do not apply it
(
data
,
indices
,
indptr
,
shape
)
=
inputs
(
data
,
indices
,
indptr
,
shape
)
=
inputs
(
out
,)
=
outputs
(
out
,)
=
outputs
if
self
.
kmap
is
not
None
:
warnings
.
warn
(
"Do not use kmap, it is removed"
)
if
len
(
shape
)
!=
2
:
if
len
(
shape
)
!=
2
:
raise
ValueError
(
'Shape should be an array of length 2'
)
raise
ValueError
(
'Shape should be an array of length 2'
)
...
@@ -849,7 +845,7 @@ class CSMGrad(gof.op.Op):
...
@@ -849,7 +845,7 @@ class CSMGrad(gof.op.Op):
if
kmap
==
None
:
if
kmap
==
None
:
self
.
kmap
=
kmap
self
.
kmap
=
kmap
else
:
else
:
warnings
.
war
n
(
"Do not use kmap, it is removed"
)
raise
Exceptio
n
(
"Do not use kmap, it is removed"
)
# This class always allocate a new output.
# This class always allocate a new output.
# I keep this here to help GD understand what this kmap think is.
# I keep this here to help GD understand what this kmap think is.
# if self.kmap is None:
# if self.kmap is None:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论