Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c2810beb
提交
c2810beb
authored
10月 13, 2015
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update following code review
上级
513b04ab
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
11 行增加
和
9 行删除
+11
-9
debugmode.py
theano/compile/debugmode.py
+8
-6
basic.py
theano/tensor/basic.py
+3
-3
没有找到文件。
theano/compile/debugmode.py
浏览文件 @
c2810beb
...
@@ -620,7 +620,8 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
...
@@ -620,7 +620,8 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
scan_inner_to_outer_inputs
scan_inner_to_outer_inputs
A dictionary mapping a scan ops inner function inputs to the scan op
A dictionary mapping a scan ops inner function inputs to the scan op
inputs (outer inputs) for printing purposes.
inputs (outer inputs) for printing purposes.
smap
None or the storage_map when printing an Theano function.
"""
"""
if
depth
==
0
:
if
depth
==
0
:
return
return
...
@@ -689,14 +690,14 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
...
@@ -689,14 +690,14 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
already_printed
=
a
in
done
# get_id_str put it in the dict
already_printed
=
a
in
done
# get_id_str put it in the dict
id_str
=
get_id_str
(
a
)
id_str
=
get_id_str
(
a
)
if
profile
is
None
or
a
not
in
profile
.
apply_time
:
if
len
(
a
.
outputs
)
==
1
:
if
len
(
a
.
outputs
)
==
1
:
idx
=
""
idx
=
""
else
:
else
:
idx
=
".
%
i"
%
a
.
outputs
.
index
(
r
)
idx
=
".
%
i"
%
a
.
outputs
.
index
(
r
)
data
=
""
data
=
""
if
smap
:
if
smap
:
data
=
" "
+
str
(
smap
[
a
.
outputs
[
0
]])
data
=
" "
+
str
(
smap
.
get
(
a
.
outputs
[
0
],
''
))
if
profile
is
None
or
a
not
in
profile
.
apply_time
:
print
(
'
%
s
%
s
%
s
%
s
%
s
\'
%
s
\'
%
s
%
s
%
s
%
s'
%
(
prefix
,
a
.
op
,
print
(
'
%
s
%
s
%
s
%
s
%
s
\'
%
s
\'
%
s
%
s
%
s
%
s'
%
(
prefix
,
a
.
op
,
idx
,
idx
,
id_str
,
type_str
,
id_str
,
type_str
,
...
@@ -715,7 +716,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
...
@@ -715,7 +716,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
idx
=
""
idx
=
""
else
:
else
:
idx
=
".
%
i"
%
a
.
outputs
.
index
(
r
)
idx
=
".
%
i"
%
a
.
outputs
.
index
(
r
)
print
(
"
%
s
%
s
%
s
%
s
%
s '
%
s'
%
s
%
s
%
s --> "
print
(
"
%
s
%
s
%
s
%
s
%
s '
%
s'
%
s
%
s
%
s
%
s
--> "
"
%8.2
es
%4.1
f
%% %8.2
es
%4.1
f
%%
"
"
%8.2
es
%4.1
f
%% %8.2
es
%4.1
f
%%
"
%
(
prefix
,
a
.
op
,
%
(
prefix
,
a
.
op
,
idx
,
idx
,
...
@@ -723,7 +724,8 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
...
@@ -723,7 +724,8 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
r_name
,
r_name
,
destroy_map_str
,
destroy_map_str
,
view_map_str
,
view_map_str
,
o
,
op_time
,
o
,
data
,
op_time
,
op_time_percent
,
op_time_percent
,
tot_time
,
tot_time
,
tot_time_percent
),
file
=
file
)
tot_time_percent
),
file
=
file
)
...
@@ -768,7 +770,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
...
@@ -768,7 +770,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
# this is an input variable
# this is an input variable
data
=
""
data
=
""
if
smap
:
if
smap
:
data
=
" "
+
str
(
smap
[
r
]
)
data
=
" "
+
str
(
smap
.
get
(
r
,
''
)
)
id_str
=
get_id_str
(
r
)
id_str
=
get_id_str
(
r
)
print
(
'
%
s
%
s
%
s
%
s
%
s'
%
(
prefix
,
r
,
id_str
,
print
(
'
%
s
%
s
%
s
%
s
%
s'
%
(
prefix
,
r
,
id_str
,
type_str
,
data
),
type_str
,
data
),
...
...
theano/tensor/basic.py
浏览文件 @
c2810beb
...
@@ -2664,9 +2664,9 @@ class Alloc(gof.Op):
...
@@ -2664,9 +2664,9 @@ class Alloc(gof.Op):
(
i
,
s_as_str
))
(
i
,
s_as_str
))
if
s
.
ndim
!=
0
:
if
s
.
ndim
!=
0
:
raise
TypeError
(
raise
TypeError
(
'Each shape dimensions to Alloc must be scalars, '
"Each shape dimension to Alloc must be a scalar, "
,
'but dimension
s
%
s is not for apply node:
%
s'
%
'but dimension
%
s is not for apply node:
%
s'
%
(
i
,
s_as_str
))
(
i
,
s_as_str
,
s
.
ndim
))
# if s is constant 1, then we're broadcastable in that dim
# if s is constant 1, then we're broadcastable in that dim
try
:
try
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论