Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
08bd312a
提交
08bd312a
authored
11月 28, 2014
作者:
serdyuk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed comparisons with None
上级
5c9e0b31
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
5 行增加
和
5 行删除
+5
-5
function_module.py
theano/compile/function_module.py
+1
-1
test_function_module.py
theano/compile/tests/test_function_module.py
+1
-1
basic.py
theano/sparse/basic.py
+1
-1
nlinalg.py
theano/tensor/nlinalg.py
+2
-2
没有找到文件。
theano/compile/function_module.py
浏览文件 @
08bd312a
...
@@ -1069,7 +1069,7 @@ class FunctionMaker(object):
...
@@ -1069,7 +1069,7 @@ class FunctionMaker(object):
if
hasattr
(
remove
,
'fgraph'
):
if
hasattr
(
remove
,
'fgraph'
):
del
remove
.
fgraph
del
remove
.
fgraph
if
hasattr
(
remove
,
'owner'
):
if
hasattr
(
remove
,
'owner'
):
if
remove
.
owner
==
None
:
if
remove
.
owner
is
None
:
pass
pass
else
:
else
:
if
hasattr
(
remove
.
owner
,
'fgraph'
):
if
hasattr
(
remove
.
owner
,
'fgraph'
):
...
...
theano/compile/tests/test_function_module.py
浏览文件 @
08bd312a
...
@@ -28,7 +28,7 @@ def checkfor(testcase, fn, E):
...
@@ -28,7 +28,7 @@ def checkfor(testcase, fn, E):
# we got the exception we wanted
# we got the exception we wanted
return
return
else
:
else
:
# we did not get
t
he exception we wanted
# we did not get
is
he exception we wanted
raise
raise
# fn worked, but it shouldn't have
# fn worked, but it shouldn't have
testcase
.
fail
()
testcase
.
fail
()
...
...
theano/sparse/basic.py
浏览文件 @
08bd312a
...
@@ -1627,7 +1627,7 @@ class SpSum(gof.op.Op):
...
@@ -1627,7 +1627,7 @@ class SpSum(gof.op.Op):
return
gof
.
Apply
(
self
,
[
x
],
[
z
])
return
gof
.
Apply
(
self
,
[
x
],
[
z
])
def
perform
(
self
,
node
,
(
x
,),
(
z
,)):
def
perform
(
self
,
node
,
(
x
,),
(
z
,)):
if
self
.
axis
==
None
:
if
self
.
axis
is
None
:
z
[
0
]
=
numpy
.
asarray
(
x
.
sum
())
z
[
0
]
=
numpy
.
asarray
(
x
.
sum
())
else
:
else
:
z
[
0
]
=
numpy
.
asarray
(
x
.
sum
(
self
.
axis
))
.
ravel
()
z
[
0
]
=
numpy
.
asarray
(
x
.
sum
(
self
.
axis
))
.
ravel
()
...
...
theano/tensor/nlinalg.py
浏览文件 @
08bd312a
...
@@ -670,7 +670,7 @@ def norm(x,ord):
...
@@ -670,7 +670,7 @@ def norm(x,ord):
if
ndim
==
0
:
if
ndim
==
0
:
raise
ValueError
(
"'axis' entry is out of bounds."
)
raise
ValueError
(
"'axis' entry is out of bounds."
)
elif
ndim
==
1
:
elif
ndim
==
1
:
if
ord
==
None
:
if
ord
is
None
:
return
tensor
.
sum
(
x
**
2
)
**
0.5
return
tensor
.
sum
(
x
**
2
)
**
0.5
elif
ord
==
'inf'
:
elif
ord
==
'inf'
:
return
tensor
.
max
(
abs
(
x
))
return
tensor
.
max
(
abs
(
x
))
...
@@ -685,7 +685,7 @@ def norm(x,ord):
...
@@ -685,7 +685,7 @@ def norm(x,ord):
raise
ValueError
(
"Invalid norm order for vectors."
)
raise
ValueError
(
"Invalid norm order for vectors."
)
return
z
return
z
elif
ndim
==
2
:
elif
ndim
==
2
:
if
ord
==
None
or
ord
==
'fro'
:
if
ord
is
None
or
ord
==
'fro'
:
return
tensor
.
sum
(
abs
(
x
**
2
))
**
(
0.5
)
return
tensor
.
sum
(
abs
(
x
**
2
))
**
(
0.5
)
elif
ord
==
'inf'
:
elif
ord
==
'inf'
:
return
tensor
.
max
(
tensor
.
sum
(
abs
(
x
),
1
))
return
tensor
.
max
(
tensor
.
sum
(
abs
(
x
),
1
))
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论