Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d44efbcd
提交
d44efbcd
authored
4月 06, 2010
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lowered the profiler overhead.
上级
91b67a6d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
6 行增加
和
4 行删除
+6
-4
profilemode.py
theano/compile/profilemode.py
+4
-4
link.py
theano/gof/link.py
+2
-0
没有找到文件。
theano/compile/profilemode.py
浏览文件 @
d44efbcd
...
@@ -25,7 +25,8 @@ class Profile_Maker(FunctionMaker):
...
@@ -25,7 +25,8 @@ class Profile_Maker(FunctionMaker):
for
i
,
node
in
enumerate
(
ret
.
maker
.
env
.
toposort
()):
for
i
,
node
in
enumerate
(
ret
.
maker
.
env
.
toposort
()):
self
.
mode
.
apply_time
[(
i
,
node
)]
=
0.0
self
.
mode
.
apply_time
[(
i
,
node
)]
=
0.0
self
.
mode
.
apply_call
[(
i
,
node
)]
=
0
self
.
mode
.
apply_call
[(
i
,
node
)]
=
0
# self.mode.op_cimpl[node.op] =
assert
len
(
ret
.
fn
.
thunk_groups
[
i
])
==
1
self
.
mode
.
op_cimpl
[
node
.
op
]
=
hasattr
(
ret
.
fn
.
thunk_groups
[
i
][
0
],
'cthunk'
)
return
ret
return
ret
...
@@ -71,7 +72,7 @@ class ProfileMode(Mode):
...
@@ -71,7 +72,7 @@ class ProfileMode(Mode):
self
.
call_time
=
0
self
.
call_time
=
0
self
.
fn_time
=
0
self
.
fn_time
=
0
def
blah
(
i
,
node
,
th
):
def
profile_thunk
(
i
,
node
,
th
):
if
hasattr
(
th
,
'cthunk'
):
if
hasattr
(
th
,
'cthunk'
):
t0
=
time
.
time
()
t0
=
time
.
time
()
failure
=
run_cthunk
(
th
.
cthunk
)
failure
=
run_cthunk
(
th
.
cthunk
)
...
@@ -88,7 +89,6 @@ class ProfileMode(Mode):
...
@@ -88,7 +89,6 @@ class ProfileMode(Mode):
local_time
[
0
]
+=
dt
local_time
[
0
]
+=
dt
apply_time
[(
i
,
node
)]
+=
dt
apply_time
[(
i
,
node
)]
+=
dt
apply_call
[(
i
,
node
)]
+=
1
apply_call
[(
i
,
node
)]
+=
1
op_cimpl
[
node
.
op
]
=
hasattr
(
th
,
'cthunk'
)
self
.
provided_linker
=
linker
self
.
provided_linker
=
linker
...
@@ -96,7 +96,7 @@ class ProfileMode(Mode):
...
@@ -96,7 +96,7 @@ class ProfileMode(Mode):
if
isinstance
(
linker
,
str
)
or
linker
is
None
:
if
isinstance
(
linker
,
str
)
or
linker
is
None
:
linker
=
predefined_linkers
[
linker
]
linker
=
predefined_linkers
[
linker
]
linker
=
WrapLinker
([
linker
],
blah
)
linker
=
WrapLinker
([
linker
],
profile_thunk
)
self
.
linker
=
linker
self
.
linker
=
linker
if
isinstance
(
optimizer
,
str
)
or
optimizer
is
None
:
if
isinstance
(
optimizer
,
str
)
or
optimizer
is
None
:
...
...
theano/gof/link.py
浏览文件 @
d44efbcd
...
@@ -5,6 +5,7 @@ from type import Type
...
@@ -5,6 +5,7 @@ from type import Type
import
sys
,
traceback
import
sys
,
traceback
from
copy
import
copy
from
copy
import
copy
from
theano.gof.python25
import
all
__excepthook
=
sys
.
excepthook
__excepthook
=
sys
.
excepthook
def
thunk_hook
(
type
,
value
,
trace
):
def
thunk_hook
(
type
,
value
,
trace
):
...
@@ -533,6 +534,7 @@ class WrapLinker(Linker):
...
@@ -533,6 +534,7 @@ class WrapLinker(Linker):
wrapper
(
i
,
node
,
*
thunks
)
wrapper
(
i
,
node
,
*
thunks
)
except
:
except
:
raise_with_op
(
node
)
raise_with_op
(
node
)
f
.
thunk_groups
=
thunk_groups
return
f
,
inputs0
,
outputs0
return
f
,
inputs0
,
outputs0
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论