Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
11e1a823
提交
11e1a823
authored
12月 12, 2015
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Preserv the nan_guard_mode_check
上级
578ad4fd
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
13 行增加
和
8 行删除
+13
-8
function_module.py
theano/compile/function_module.py
+1
-1
nanguardmode.py
theano/compile/nanguardmode.py
+1
-1
toolbox.py
theano/gof/toolbox.py
+7
-1
scan_utils.py
theano/scan_module/scan_utils.py
+1
-1
basic.py
theano/tensor/basic.py
+3
-1
opt.py
theano/tensor/opt.py
+0
-3
没有找到文件。
theano/compile/function_module.py
浏览文件 @
11e1a823
...
@@ -199,7 +199,7 @@ def std_fgraph(input_specs, output_specs, accept_inplace=False):
...
@@ -199,7 +199,7 @@ def std_fgraph(input_specs, output_specs, accept_inplace=False):
return
fgraph
,
list
(
map
(
SymbolicOutput
,
updates
))
return
fgraph
,
list
(
map
(
SymbolicOutput
,
updates
))
std_fgraph
.
features
=
[
gof
.
toolbox
.
Preserve
Nam
es
]
std_fgraph
.
features
=
[
gof
.
toolbox
.
Preserve
VariableAttribut
es
]
class
AliasedMemoryError
(
Exception
):
class
AliasedMemoryError
(
Exception
):
...
...
theano/compile/nanguardmode.py
浏览文件 @
11e1a823
...
@@ -323,7 +323,7 @@ class NanGuardMode(Mode):
...
@@ -323,7 +323,7 @@ class NanGuardMode(Mode):
fn
()
fn
()
outputs
=
fn
.
outputs
outputs
=
fn
.
outputs
for
x
,
var
in
zip
(
outputs
,
node
.
outputs
):
for
x
,
var
in
zip
(
outputs
,
node
.
outputs
):
if
getattr
(
var
,
'nan_guard_mode_check'
,
True
):
if
getattr
(
var
.
tag
,
'nan_guard_mode_check'
,
True
):
do_check_on
(
x
[
0
],
node
,
fn
,
False
)
do_check_on
(
x
[
0
],
node
,
fn
,
False
)
wrap_linker
=
theano
.
gof
.
WrapLinker
([
theano
.
gof
.
OpWiseCLinker
()],
wrap_linker
=
theano
.
gof
.
WrapLinker
([
theano
.
gof
.
OpWiseCLinker
()],
...
...
theano/gof/toolbox.py
浏览文件 @
11e1a823
...
@@ -454,11 +454,17 @@ class PrintListener(Feature):
...
@@ -454,11 +454,17 @@ class PrintListener(Feature):
node
,
i
,
r
,
new_r
))
node
,
i
,
r
,
new_r
))
class
PreserveNames
(
Feature
):
class
PreserveVariableAttributes
(
Feature
):
"""
This preserve some variables attributes and tag during optimization.
"""
def
on_change_input
(
self
,
fgraph
,
node
,
i
,
r
,
new_r
,
reason
=
None
):
def
on_change_input
(
self
,
fgraph
,
node
,
i
,
r
,
new_r
,
reason
=
None
):
if
r
.
name
is
not
None
and
new_r
.
name
is
None
:
if
r
.
name
is
not
None
and
new_r
.
name
is
None
:
new_r
.
name
=
r
.
name
new_r
.
name
=
r
.
name
if
getattr
(
r
.
tag
,
'nan_guard_mode_check'
,
False
)
and
getattr
(
new_r
.
tag
,
'nan_guard_mode_check'
,
False
)
is
False
:
new_r
.
tag
.
nan_guard_mode_check
=
r
.
tag
.
nan_guard_mode_check
class
NoOutputFromInplace
(
Feature
):
class
NoOutputFromInplace
(
Feature
):
...
...
theano/scan_module/scan_utils.py
浏览文件 @
11e1a823
...
@@ -621,7 +621,7 @@ def expand_empty(tensor_var, size):
...
@@ -621,7 +621,7 @@ def expand_empty(tensor_var, size):
empty
=
tensor
.
AllocEmpty
(
tensor_var
.
dtype
)(
*
new_shape
)
empty
=
tensor
.
AllocEmpty
(
tensor_var
.
dtype
)(
*
new_shape
)
ret
=
tensor
.
set_subtensor
(
empty
[:
shapes
[
0
]],
tensor_var
)
ret
=
tensor
.
set_subtensor
(
empty
[:
shapes
[
0
]],
tensor_var
)
ret
.
nan_guard_mode_check
=
False
ret
.
tag
.
nan_guard_mode_check
=
False
return
ret
return
ret
...
...
theano/tensor/basic.py
浏览文件 @
11e1a823
...
@@ -6242,7 +6242,9 @@ class AllocEmpty(gof.Op):
...
@@ -6242,7 +6242,9 @@ class AllocEmpty(gof.Op):
# We can't reuse filter_checks_isfinite as by default it is
# We can't reuse filter_checks_isfinite as by default it is
# False and it is set to true only in DebugMode.
# False and it is set to true only in DebugMode.
# We can't set it in the type as other make_node can reuse the type.
# We can't set it in the type as other make_node can reuse the type.
output
.
nan_guard_mode_check
=
False
# We can't set it in the variable as it isn't copied when we copy
# the variale. So we set it in the tag.
output
.
tag
.
nan_guard_mode_check
=
False
return
Apply
(
self
,
shape
,
[
output
])
return
Apply
(
self
,
shape
,
[
output
])
def
perform
(
self
,
node
,
inputs
,
out_
):
def
perform
(
self
,
node
,
inputs
,
out_
):
...
...
theano/tensor/opt.py
浏览文件 @
11e1a823
...
@@ -3076,9 +3076,6 @@ def local_inplace_setsubtensor(node):
...
@@ -3076,9 +3076,6 @@ def local_inplace_setsubtensor(node):
set_instead_of_inc
=
node
.
op
.
set_instead_of_inc
,
set_instead_of_inc
=
node
.
op
.
set_instead_of_inc
,
destroyhandler_tolerate_aliased
=
dta
)
destroyhandler_tolerate_aliased
=
dta
)
new_node
=
new_op
(
*
node
.
inputs
)
new_node
=
new_op
(
*
node
.
inputs
)
# Keep the information needed for NanGuardMode.
new_node
.
nan_guard_mode_check
=
getattr
(
node
.
op
,
'nan_guard_mode_check'
,
True
)
# Copy stacktrace from original outputs to new outputs.
# Copy stacktrace from original outputs to new outputs.
# This is sensible, because the new operation is the
# This is sensible, because the new operation is the
# same as the old one, but now with different attributes.
# same as the old one, but now with different attributes.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论