Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
dadbdcc0
提交
dadbdcc0
authored
3月 06, 2015
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove untested SanityCheckFunction (jul 2013)
上级
d7d28014
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
0 行增加
和
75 行删除
+0
-75
function_module.py
theano/compile/function_module.py
+0
-75
没有找到文件。
theano/compile/function_module.py
浏览文件 @
dadbdcc0
...
@@ -755,81 +755,6 @@ def _constructor_Function(maker, input_storage, inputs_data):
...
@@ -755,81 +755,6 @@ def _constructor_Function(maker, input_storage, inputs_data):
copy_reg
.
pickle
(
Function
,
_pickle_Function
)
copy_reg
.
pickle
(
Function
,
_pickle_Function
)
###
### SanityCheckFunction
###
class
SanityCheckFunction
(
Function
):
"""Deprecated. It is not used and not tested anywhere in Theano!
Also, we should remove the check_equal and related function in
this file, and use Type.values_equals() instead.
"""
def
__init__
(
self
,
others
,
check_equal
,
*
args
,
**
kwargs
):
super
(
SanityCheckFunction
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
others
=
others
self
.
check_equal
=
check_equal
# DEPRECATED? Is this just for DualLinker?
warnings
.
warn
(
"SanityCheckFunction is deprecated"
)
def
__setitem__
(
self
,
item
,
value
):
super
(
SanityCheckFunction
,
self
)
.
__setitem__
(
item
,
value
)
for
fn
in
self
.
others
:
fn
[
item
]
=
value
def
__call__
(
self
,
*
args
,
**
kwargs
):
for
fn
in
self
.
others
:
for
stor1
,
stor2
in
zip
(
self
.
input_storage
,
fn
.
input_storage
):
stor2
.
value
=
copy
.
copy
(
stor1
.
value
)
variables
=
super
(
SanityCheckFunction
,
self
)
.
__call__
(
*
args
,
**
kwargs
)
all_outputs
=
[
copy
.
copy
(
c
.
value
)
for
c
in
self
.
output_storage
]
# we keep a copy to make sure it's not overwritten
for
fn
in
self
.
others
:
fn
(
*
args
,
**
kwargs
)
for
i
,
(
c1
,
c2
,
input
)
in
enumerate
(
zip
(
self
.
input_storage
,
fn
.
input_storage
,
self
.
maker
.
inputs
)):
if
not
input
.
mutable
:
if
not
self
.
check_equal
(
c1
.
value
,
c2
.
value
):
name
=
c2
.
name
if
name
:
the_name
=
name
else
:
the_name
=
""
raise
ValueError
(
"Input #
%
i
%
s using
%
s and
%
s differs."
%
(
i
,
#backport
#" (%s)" % name if name else "",
" (
%
s)"
%
the_name
,
self
.
maker
.
mode
,
fn
.
maker
.
mode
),
c1
.
value
,
c2
.
value
)
# This checks all output storage (this includes state variables that we updated)
# This is ok because the variables of a call stick around in their storage
for
i
,
(
r1
,
c2
)
in
enumerate
(
zip
(
all_outputs
,
fn
.
output_storage
)):
r2
=
c2
.
value
if
not
self
.
check_equal
(
r1
,
r2
):
name
=
c2
.
name
if
name
:
the_name
=
name
else
:
the_name
=
""
raise
ValueError
(
"Variable #
%
i
%
s using
%
s and
%
s differs."
%
(
i
,
#backport
#" (%s)" % name if name else "",
" (
%
s)"
%
the_name
,
self
.
maker
.
mode
,
fn
.
maker
.
mode
),
r1
,
r2
)
return
variables
###
###
### FunctionMaker
### FunctionMaker
###
###
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论