Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
35ff6f6a
提交
35ff6f6a
authored
5月 11, 2011
作者:
Olivier Delalleau
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes related to the new usage of ShapeError instead of NotImplementedError
上级
61493b72
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
5 行增加
和
3 行删除
+5
-3
apply_shape.py
theano/gof/apply_shape.py
+2
-1
conv.py
theano/tensor/nnet/conv.py
+3
-2
没有找到文件。
theano/gof/apply_shape.py
浏览文件 @
35ff6f6a
...
@@ -4,6 +4,7 @@ This is not used currently very used. It appear in some case, but I'm not sure i
...
@@ -4,6 +4,7 @@ This is not used currently very used. It appear in some case, but I'm not sure i
It could help the current system to make it detect problem earlier when contructing the graph instead of during optimization.
It could help the current system to make it detect problem earlier when contructing the graph instead of during optimization.
"""
"""
import
sys
import
sys
import
theano
from
theano
import
gof
from
theano
import
gof
def
ishape
(
v
):
def
ishape
(
v
):
...
@@ -35,7 +36,7 @@ class Apply(gof.Apply):
...
@@ -35,7 +36,7 @@ class Apply(gof.Apply):
try
:
try
:
oshapes
=
infer_shape
(
self
,
ishapes
)
oshapes
=
infer_shape
(
self
,
ishapes
)
except
NotImplemented
Error
:
except
theano
.
tensor
.
opt
.
Shape
Error
:
return
return
for
o
,
oshp
in
zip
(
outputs
,
oshapes
):
for
o
,
oshp
in
zip
(
outputs
,
oshapes
):
...
...
theano/tensor/nnet/conv.py
浏览文件 @
35ff6f6a
...
@@ -575,14 +575,15 @@ class ConvOp(Op):
...
@@ -575,14 +575,15 @@ class ConvOp(Op):
try
:
try
:
fmshp
=
ConvOp
.
getOutputShape
(
imshp
[
1
:],
kshp
,
(
self
.
dx
,
self
.
dy
),
self
.
out_mode
)
fmshp
=
ConvOp
.
getOutputShape
(
imshp
[
1
:],
kshp
,
(
self
.
dx
,
self
.
dy
),
self
.
out_mode
)
except
TypeError
:
except
TypeError
:
raise
NotImplemented
Error
()
raise
theano
.
tensor
.
opt
.
Shape
Error
()
outshp
=
(
batch_size
,
fmo
)
+
tuple
(
fmshp
)
outshp
=
(
batch_size
,
fmo
)
+
tuple
(
fmshp
)
return
[
outshp
]
return
[
outshp
]
else
:
else
:
# Haven't implemented this case. imshp and kshp may be symbollic
# Haven't implemented this case. imshp and kshp may be symbollic
# and ConvOp.getOutputShape doesn't handle this. In this case
# and ConvOp.getOutputShape doesn't handle this. In this case
# we simply let the default function do its work.
# we simply let the default function do its work.
raise
NotImplementedError
()
raise
theano
.
tensor
.
opt
.
ShapeError
()
def
perform
(
self
,
node
,
inp
,
out
):
def
perform
(
self
,
node
,
inp
,
out
):
"""
"""
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论