Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
594dbd74
提交
594dbd74
authored
1月 23, 2017
作者:
affanv14
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix bug caused when setting default value in Param
上级
9b0f65a8
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
5 行删除
+10
-5
function_module.py
theano/compile/function_module.py
+10
-5
没有找到文件。
theano/compile/function_module.py
浏览文件 @
594dbd74
...
@@ -749,6 +749,12 @@ class Function(object):
...
@@ -749,6 +749,12 @@ class Function(object):
List of outputs on indices/keys from ``output_subset`` or all of them,
List of outputs on indices/keys from ``output_subset`` or all of them,
if ``output_subset`` is not passed.
if ``output_subset`` is not passed.
"""
"""
def
restore_defaults
():
for
i
,
(
required
,
refeed
,
value
)
in
enumerate
(
self
.
defaults
):
if
refeed
:
if
isinstance
(
value
,
gof
.
Container
):
value
=
value
.
storage
[
0
]
self
[
i
]
=
value
profile
=
self
.
profile
profile
=
self
.
profile
t0
=
time
.
time
()
t0
=
time
.
time
()
...
@@ -853,14 +859,17 @@ class Function(object):
...
@@ -853,14 +859,17 @@ class Function(object):
if
not
self
.
trust_input
:
if
not
self
.
trust_input
:
for
c
in
self
.
input_storage
:
for
c
in
self
.
input_storage
:
if
c
.
required
and
not
c
.
provided
:
if
c
.
required
and
not
c
.
provided
:
restore_defaults
()
raise
TypeError
(
"Missing required input:
%
s"
%
raise
TypeError
(
"Missing required input:
%
s"
%
getattr
(
self
.
inv_finder
[
c
],
'variable'
,
getattr
(
self
.
inv_finder
[
c
],
'variable'
,
self
.
inv_finder
[
c
]))
self
.
inv_finder
[
c
]))
if
c
.
provided
>
1
:
if
c
.
provided
>
1
:
restore_defaults
()
raise
TypeError
(
"Multiple values for input:
%
s"
%
raise
TypeError
(
"Multiple values for input:
%
s"
%
getattr
(
self
.
inv_finder
[
c
],
'variable'
,
getattr
(
self
.
inv_finder
[
c
],
'variable'
,
self
.
inv_finder
[
c
]))
self
.
inv_finder
[
c
]))
if
c
.
implicit
and
c
.
provided
>
0
:
if
c
.
implicit
and
c
.
provided
>
0
:
restore_defaults
()
raise
TypeError
(
raise
TypeError
(
'Tried to provide value for implicit input:
%
s'
'Tried to provide value for implicit input:
%
s'
%
getattr
(
self
.
inv_finder
[
c
],
'variable'
,
%
getattr
(
self
.
inv_finder
[
c
],
'variable'
,
...
@@ -925,11 +934,7 @@ class Function(object):
...
@@ -925,11 +934,7 @@ class Function(object):
outputs
=
outputs
[:
self
.
n_returned_outputs
]
outputs
=
outputs
[:
self
.
n_returned_outputs
]
# Put default values back in the storage
# Put default values back in the storage
for
i
,
(
required
,
refeed
,
value
)
in
enumerate
(
self
.
defaults
):
restore_defaults
()
if
refeed
:
if
isinstance
(
value
,
gof
.
Container
):
value
=
value
.
storage
[
0
]
self
[
i
]
=
value
#
#
# NOTE: This logic needs to be replicated in
# NOTE: This logic needs to be replicated in
# scan.
# scan.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论