Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4c0014de
提交
4c0014de
authored
7月 22, 2016
作者:
Jakub Sygnowski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
documentation of the update part of partial function evaluation
上级
7a9862b2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
9 行删除
+17
-9
function_module.py
theano/compile/function_module.py
+5
-1
test_vm.py
theano/gof/tests/test_vm.py
+12
-8
没有找到文件。
theano/compile/function_module.py
浏览文件 @
4c0014de
...
...
@@ -735,9 +735,13 @@ class Function(object):
kwargs : dict
The function inputs can be passed as keyword argument. For this, use
the name of the input or the input instance as the key.
Keyword argument ``output_subset`` is a list of either indices of the
function's outputs or the keys belonging to the `output_keys` dict
and represent outputs that are requested to be calculated.
and represent outputs that are requested to be calculated. Regardless
of the presence of ``output_subset``, the updates are always calculated
and processed. To disable the updates, you should use the ``copy``
method with ``delete_updates=False``.
Returns
-------
...
...
theano/gof/tests/test_vm.py
浏览文件 @
4c0014de
...
...
@@ -212,14 +212,18 @@ def test_partial_function():
check_partial_function
(
'cvm'
)
# TODO: implement output_keys with CVM
def
test_partial_function_output_keys
():
x
=
tensor
.
scalar
(
'input'
)
y
=
3
*
x
f
=
theano
.
function
([
x
],
{
'a'
:
y
*
5
,
'b'
:
y
-
7
},
mode
=
Mode
(
optimizer
=
None
,
linker
=
vm
.
VM_Linker
(
allow_partial_eval
=
True
)))
assert
f
(
5
,
output_subset
=
[
'a'
])[
'a'
]
==
f
(
5
)[
'a'
]
def
test_partial_function_with_output_keys
():
def
check_partial_function_output_keys
(
linker_name
):
x
=
tensor
.
scalar
(
'input'
)
y
=
3
*
x
f
=
theano
.
function
([
x
],
{
'a'
:
y
*
5
,
'b'
:
y
-
7
},
mode
=
Mode
(
optimizer
=
None
,
linker
=
linker_name
))
assert
f
(
5
,
output_subset
=
[
'a'
])[
'a'
]
==
f
(
5
)[
'a'
]
check_partial_function_output_keys
(
vm
.
VM_Linker
(
allow_partial_eval
=
True
))
check_partial_function_output_keys
(
'cvm'
)
def
test_partial_function_with_updates
():
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论