Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
b7cbe8fb
提交
b7cbe8fb
authored
6月 09, 2011
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added an option in pydotprint* to put less information in the graph when we have…
Added an option in pydotprint* to put less information in the graph when we have gived a name to a variable.
上级
a102d8e7
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
18 行增加
和
6 行删除
+18
-6
printing.py
theano/printing.py
+18
-6
没有找到文件。
theano/printing.py
浏览文件 @
b7cbe8fb
...
@@ -392,8 +392,10 @@ default_colorCodes = {'GpuFromHost' : 'red',
...
@@ -392,8 +392,10 @@ default_colorCodes = {'GpuFromHost' : 'red',
def
pydotprint
(
fct
,
outfile
=
None
,
def
pydotprint
(
fct
,
outfile
=
None
,
compact
=
True
,
format
=
'png'
,
with_ids
=
False
,
compact
=
True
,
format
=
'png'
,
with_ids
=
False
,
high_contrast
=
True
,
cond_highlight
=
None
,
colorCodes
=
None
,
high_contrast
=
True
,
cond_highlight
=
None
,
colorCodes
=
None
,
max_label_size
=
50
,
scan_graphs
=
False
):
max_label_size
=
50
,
scan_graphs
=
False
,
var_with_name_simple
=
False
):
"""
"""
print to a file in png format the graph of op of a compile theano fct.
print to a file in png format the graph of op of a compile theano fct.
...
@@ -493,14 +495,20 @@ def pydotprint(fct, outfile=None,
...
@@ -493,14 +495,20 @@ def pydotprint(fct, outfile=None,
return
var_str
[
var
]
return
var_str
[
var
]
if
var
.
name
is
not
None
:
if
var
.
name
is
not
None
:
varstr
=
'name='
+
var
.
name
+
" "
+
str
(
var
.
type
)
if
var_with_name_simple
:
varstr
=
var
.
name
else
:
varstr
=
'name='
+
var
.
name
+
" "
+
str
(
var
.
type
)
elif
isinstance
(
var
,
gof
.
Constant
):
elif
isinstance
(
var
,
gof
.
Constant
):
dstr
=
'val='
+
str
(
numpy
.
asarray
(
var
.
data
))
dstr
=
'val='
+
str
(
numpy
.
asarray
(
var
.
data
))
if
'
\n
'
in
dstr
:
if
'
\n
'
in
dstr
:
dstr
=
dstr
[:
dstr
.
index
(
'
\n
'
)]
dstr
=
dstr
[:
dstr
.
index
(
'
\n
'
)]
varstr
=
'
%
s [
%
s]'
%
(
dstr
,
str
(
var
.
type
))
varstr
=
'
%
s [
%
s]'
%
(
dstr
,
str
(
var
.
type
))
elif
var
in
input_update
and
input_update
[
var
]
.
variable
.
name
is
not
None
:
elif
var
in
input_update
and
input_update
[
var
]
.
variable
.
name
is
not
None
:
varstr
=
input_update
[
var
]
.
variable
.
name
+
" "
+
str
(
var
.
type
)
if
var_with_name_simple
:
varstr
=
input_update
[
var
]
.
variable
.
name
else
:
varstr
=
input_update
[
var
]
.
variable
.
name
+
" "
+
str
(
var
.
type
)
else
:
else
:
#a var id is needed as otherwise var with the same type will be merged in the graph.
#a var id is needed as otherwise var with the same type will be merged in the graph.
varstr
=
str
(
var
.
type
)
varstr
=
str
(
var
.
type
)
...
@@ -667,7 +675,8 @@ def pydotprint_variables(vars,
...
@@ -667,7 +675,8 @@ def pydotprint_variables(vars,
format
=
'png'
,
format
=
'png'
,
depth
=-
1
,
depth
=-
1
,
high_contrast
=
True
,
colorCodes
=
None
,
high_contrast
=
True
,
colorCodes
=
None
,
max_label_size
=
50
):
max_label_size
=
50
,
var_with_name_simple
=
False
):
''' Identical to pydotprint just that it starts from a variable instead
''' Identical to pydotprint just that it starts from a variable instead
of a compiled function. Could be useful ? '''
of a compiled function. Could be useful ? '''
...
@@ -692,7 +701,10 @@ def pydotprint_variables(vars,
...
@@ -692,7 +701,10 @@ def pydotprint_variables(vars,
return
var_str
[
var
]
return
var_str
[
var
]
if
var
.
name
is
not
None
:
if
var
.
name
is
not
None
:
varstr
=
'name='
+
var
.
name
if
var_with_name_simple
:
varstr
=
var
.
name
else
:
varstr
=
'name='
+
var
.
name
+
" "
+
str
(
var
.
type
)
elif
isinstance
(
var
,
gof
.
Constant
):
elif
isinstance
(
var
,
gof
.
Constant
):
dstr
=
'val='
+
str
(
var
.
data
)
dstr
=
'val='
+
str
(
var
.
data
)
if
'
\n
'
in
dstr
:
if
'
\n
'
in
dstr
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论