Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
578ad4fd
提交
578ad4fd
authored
12月 11, 2015
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't let scan AllocEmpty cause false alarm by NanGuardMode
上级
e088e2a8
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
13 行增加
和
2 行删除
+13
-2
nanguardmode.py
theano/compile/nanguardmode.py
+2
-1
scan_utils.py
theano/scan_module/scan_utils.py
+3
-1
basic.py
theano/tensor/basic.py
+5
-0
opt.py
theano/tensor/opt.py
+3
-0
没有找到文件。
theano/compile/nanguardmode.py
浏览文件 @
578ad4fd
...
@@ -322,7 +322,8 @@ class NanGuardMode(Mode):
...
@@ -322,7 +322,8 @@ class NanGuardMode(Mode):
do_check_on
(
x
[
0
],
node
,
fn
,
True
)
do_check_on
(
x
[
0
],
node
,
fn
,
True
)
fn
()
fn
()
outputs
=
fn
.
outputs
outputs
=
fn
.
outputs
for
x
in
outputs
:
for
x
,
var
in
zip
(
outputs
,
node
.
outputs
):
if
getattr
(
var
,
'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/scan_module/scan_utils.py
浏览文件 @
578ad4fd
...
@@ -620,7 +620,9 @@ def expand_empty(tensor_var, size):
...
@@ -620,7 +620,9 @@ def expand_empty(tensor_var, size):
new_shape
=
[
size
+
shapes
[
0
]]
+
shapes
[
1
:]
new_shape
=
[
size
+
shapes
[
0
]]
+
shapes
[
1
:]
empty
=
tensor
.
AllocEmpty
(
tensor_var
.
dtype
)(
*
new_shape
)
empty
=
tensor
.
AllocEmpty
(
tensor_var
.
dtype
)(
*
new_shape
)
return
tensor
.
set_subtensor
(
empty
[:
shapes
[
0
]],
tensor_var
)
ret
=
tensor
.
set_subtensor
(
empty
[:
shapes
[
0
]],
tensor_var
)
ret
.
nan_guard_mode_check
=
False
return
ret
def
equal_computations
(
xs
,
ys
,
in_xs
=
None
,
in_ys
=
None
):
def
equal_computations
(
xs
,
ys
,
in_xs
=
None
,
in_ys
=
None
):
...
...
theano/tensor/basic.py
浏览文件 @
578ad4fd
...
@@ -6238,6 +6238,11 @@ class AllocEmpty(gof.Op):
...
@@ -6238,6 +6238,11 @@ class AllocEmpty(gof.Op):
# The outut can contain nan/inf. output.type is a new
# The outut can contain nan/inf. output.type is a new
# instance, so we can do this only for that variable.
# instance, so we can do this only for that variable.
output
.
type
.
filter_checks_isfinite
=
False
output
.
type
.
filter_checks_isfinite
=
False
# We can't reuse filter_checks_isfinite as by default it is
# 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.
output
.
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
浏览文件 @
578ad4fd
...
@@ -3076,6 +3076,9 @@ def local_inplace_setsubtensor(node):
...
@@ -3076,6 +3076,9 @@ 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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论