Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
02786176
提交
02786176
authored
1月 28, 2015
作者:
carriepl
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2443 from nouiz/pydotprint
Pydotprint
上级
4c76812b
8f6a1411
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
18 行增加
和
3 行删除
+18
-3
index.txt
doc/index.txt
+1
-0
printing.py
theano/printing.py
+17
-3
没有找到文件。
doc/index.txt
浏览文件 @
02786176
...
@@ -21,6 +21,7 @@ Montreal).
...
@@ -21,6 +21,7 @@ Montreal).
News
News
====
====
* We support `cuDNN <http://deeplearning.net/software/theano/library/sandbox/cuda/dnn.html>`_ if it is installed by the user.
* Open Machine Learning Workshop 2014 `presentation <omlw2014/omlw_presentation.pdf>`_.
* Open Machine Learning Workshop 2014 `presentation <omlw2014/omlw_presentation.pdf>`_.
* Colin Raffel `tutorial on Theano <http://nbviewer.ipython.org/github/craffel/theano-tutorial/blob/master/Theano%20Tutorial.ipynb>`_.
* Colin Raffel `tutorial on Theano <http://nbviewer.ipython.org/github/craffel/theano-tutorial/blob/master/Theano%20Tutorial.ipynb>`_.
...
...
theano/printing.py
浏览文件 @
02786176
...
@@ -623,6 +623,10 @@ def pydotprint(fct, outfile=None,
...
@@ -623,6 +623,10 @@ def pydotprint(fct, outfile=None,
red ellipses are transfers from/to the gpu (ops with names GpuFromHost,
red ellipses are transfers from/to the gpu (ops with names GpuFromHost,
HostFromGpu).
HostFromGpu).
For edges, they are black by default. If a node returns a view
of an input, we put the corresponding input edge in blue. If it
returns a destroyed input, we put the corresponding edge in red.
.. note::
.. note::
Since October 20th, 2014, this print the inner function of all
Since October 20th, 2014, this print the inner function of all
...
@@ -800,6 +804,9 @@ def pydotprint(fct, outfile=None,
...
@@ -800,6 +804,9 @@ def pydotprint(fct, outfile=None,
# Update the inputs that have an update function
# Update the inputs that have an update function
input_update
=
{}
input_update
=
{}
# Here outputs can be the original list, as we should not change
# it, we must copy it.
outputs
=
list
(
outputs
)
if
isinstance
(
fct
,
Function
):
if
isinstance
(
fct
,
Function
):
for
i
in
reversed
(
fct
.
maker
.
expanded_inputs
):
for
i
in
reversed
(
fct
.
maker
.
expanded_inputs
):
if
i
.
update
is
not
None
:
if
i
.
update
is
not
None
:
...
@@ -838,6 +845,13 @@ def pydotprint(fct, outfile=None,
...
@@ -838,6 +845,13 @@ def pydotprint(fct, outfile=None,
label
=
str
(
id
)
+
' '
+
label
label
=
str
(
id
)
+
' '
+
label
if
len
(
label
)
>
max_label_size
:
if
len
(
label
)
>
max_label_size
:
label
=
label
[:
max_label_size
-
3
]
+
'...'
label
=
label
[:
max_label_size
-
3
]
+
'...'
param
=
{}
if
hasattr
(
node
.
op
,
'view_map'
)
and
id
in
reduce
(
list
.
__add__
,
node
.
op
.
view_map
.
values
(),
[]):
param
[
'color'
]
=
'blue'
elif
hasattr
(
node
.
op
,
'destroy_map'
)
and
id
in
reduce
(
list
.
__add__
,
node
.
op
.
destroy_map
.
values
(),
[]):
param
[
'color'
]
=
'red'
if
var
.
owner
is
None
:
if
var
.
owner
is
None
:
if
high_contrast
:
if
high_contrast
:
g
.
add_node
(
pd
.
Node
(
varstr
,
g
.
add_node
(
pd
.
Node
(
varstr
,
...
@@ -846,12 +860,12 @@ def pydotprint(fct, outfile=None,
...
@@ -846,12 +860,12 @@ def pydotprint(fct, outfile=None,
shape
=
var_shape
))
shape
=
var_shape
))
else
:
else
:
g
.
add_node
(
pd
.
Node
(
varstr
,
color
=
'green'
,
shape
=
var_shape
))
g
.
add_node
(
pd
.
Node
(
varstr
,
color
=
'green'
,
shape
=
var_shape
))
g
.
add_edge
(
pd
.
Edge
(
varstr
,
astr
,
label
=
label
))
g
.
add_edge
(
pd
.
Edge
(
varstr
,
astr
,
label
=
label
,
**
param
))
elif
var
.
name
or
not
compact
:
elif
var
.
name
or
not
compact
:
g
.
add_edge
(
pd
.
Edge
(
varstr
,
astr
,
label
=
label
))
g
.
add_edge
(
pd
.
Edge
(
varstr
,
astr
,
label
=
label
,
**
param
))
else
:
else
:
# no name, so we don't make a var ellipse
# no name, so we don't make a var ellipse
g
.
add_edge
(
pd
.
Edge
(
apply_name
(
var
.
owner
),
astr
,
label
=
label
))
g
.
add_edge
(
pd
.
Edge
(
apply_name
(
var
.
owner
),
astr
,
label
=
label
,
**
param
))
for
id
,
var
in
enumerate
(
node
.
outputs
):
for
id
,
var
in
enumerate
(
node
.
outputs
):
varstr
=
var_name
(
var
)
varstr
=
var_name
(
var
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论