Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
616f8d37
提交
616f8d37
authored
7月 31, 2017
作者:
Reyhane Askari
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sync attribute added to theano function
上级
e89aee9d
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
16 行增加
和
7 行删除
+16
-7
function.py
theano/compile/function.py
+3
-2
function_module.py
theano/compile/function_module.py
+11
-3
pfunc.py
theano/compile/pfunc.py
+2
-2
没有找到文件。
theano/compile/function.py
浏览文件 @
616f8d37
...
@@ -76,7 +76,7 @@ def function_dump(filename, inputs, outputs=None, mode=None, updates=None,
...
@@ -76,7 +76,7 @@ def function_dump(filename, inputs, outputs=None, mode=None, updates=None,
def
function
(
inputs
,
outputs
=
None
,
mode
=
None
,
updates
=
None
,
givens
=
None
,
def
function
(
inputs
,
outputs
=
None
,
mode
=
None
,
updates
=
None
,
givens
=
None
,
no_default_updates
=
False
,
accept_inplace
=
False
,
name
=
None
,
no_default_updates
=
False
,
accept_inplace
=
False
,
name
=
None
,
rebuild_strict
=
True
,
allow_input_downcast
=
None
,
profile
=
None
,
rebuild_strict
=
True
,
allow_input_downcast
=
None
,
profile
=
None
,
on_unused_input
=
None
):
on_unused_input
=
None
,
sync
=
False
):
"""
"""
Return a :class:`callable object <theano.compile.function_module.Function>`
Return a :class:`callable object <theano.compile.function_module.Function>`
that will calculate `outputs` from `inputs`.
that will calculate `outputs` from `inputs`.
...
@@ -323,7 +323,8 @@ def function(inputs, outputs=None, mode=None, updates=None, givens=None,
...
@@ -323,7 +323,8 @@ def function(inputs, outputs=None, mode=None, updates=None, givens=None,
allow_input_downcast
=
allow_input_downcast
,
allow_input_downcast
=
allow_input_downcast
,
on_unused_input
=
on_unused_input
,
on_unused_input
=
on_unused_input
,
profile
=
profile
,
profile
=
profile
,
output_keys
=
output_keys
)
output_keys
=
output_keys
,
sync
=
sync
)
# We need to add the flag check_aliased inputs if we have any mutable or
# We need to add the flag check_aliased inputs if we have any mutable or
# borrowed used defined inputs
# borrowed used defined inputs
fn
.
_check_for_aliased_inputs
=
check_for_aliased_inputs
fn
.
_check_for_aliased_inputs
=
check_for_aliased_inputs
...
...
theano/compile/function_module.py
浏览文件 @
616f8d37
...
@@ -1390,7 +1390,8 @@ class FunctionMaker(object):
...
@@ -1390,7 +1390,8 @@ class FunctionMaker(object):
def
__init__
(
self
,
inputs
,
outputs
,
def
__init__
(
self
,
inputs
,
outputs
,
mode
=
None
,
accept_inplace
=
False
,
function_builder
=
Function
,
mode
=
None
,
accept_inplace
=
False
,
function_builder
=
Function
,
profile
=
None
,
on_unused_input
=
None
,
fgraph
=
None
,
profile
=
None
,
on_unused_input
=
None
,
fgraph
=
None
,
output_keys
=
None
):
output_keys
=
None
,
sync
=
False
):
self
.
sync
=
sync
mode
=
theano
.
compile
.
mode
.
get_mode
(
mode
)
mode
=
theano
.
compile
.
mode
.
get_mode
(
mode
)
# Assert old way of working isn't used
# Assert old way of working isn't used
...
@@ -1688,6 +1689,12 @@ class FunctionMaker(object):
...
@@ -1688,6 +1689,12 @@ class FunctionMaker(object):
fn
=
self
.
function_builder
(
_fn
,
_i
,
_o
,
self
.
indices
,
self
.
outputs
,
fn
=
self
.
function_builder
(
_fn
,
_i
,
_o
,
self
.
indices
,
self
.
outputs
,
defaults
,
self
.
unpack_single
,
defaults
,
self
.
unpack_single
,
self
.
return_none
,
self
.
output_keys
,
self
)
self
.
return_none
,
self
.
output_keys
,
self
)
if
self
.
sync
:
for
i
,
inp
in
enumerate
(
input_storage
):
if
i
in
self
.
fgraph
.
update_mapping
.
values
():
inp
.
data
.
sync
()
fn
.
profile
=
self
.
profile
fn
.
profile
=
self
.
profile
return
fn
return
fn
...
@@ -1733,7 +1740,7 @@ def register_checker(checker):
...
@@ -1733,7 +1740,7 @@ def register_checker(checker):
def
orig_function
(
inputs
,
outputs
,
mode
=
None
,
accept_inplace
=
False
,
def
orig_function
(
inputs
,
outputs
,
mode
=
None
,
accept_inplace
=
False
,
name
=
None
,
profile
=
None
,
on_unused_input
=
None
,
name
=
None
,
profile
=
None
,
on_unused_input
=
None
,
output_keys
=
None
):
output_keys
=
None
,
sync
=
False
):
"""
"""
Return a Function that will calculate the outputs from the inputs.
Return a Function that will calculate the outputs from the inputs.
...
@@ -1804,7 +1811,8 @@ def orig_function(inputs, outputs, mode=None, accept_inplace=False,
...
@@ -1804,7 +1811,8 @@ def orig_function(inputs, outputs, mode=None, accept_inplace=False,
accept_inplace
=
accept_inplace
,
accept_inplace
=
accept_inplace
,
profile
=
profile
,
profile
=
profile
,
on_unused_input
=
on_unused_input
,
on_unused_input
=
on_unused_input
,
output_keys
=
output_keys
)
output_keys
=
output_keys
,
sync
=
sync
)
with
theano
.
configparser
.
change_flags
(
compute_test_value
=
"off"
):
with
theano
.
configparser
.
change_flags
(
compute_test_value
=
"off"
):
fn
=
m
.
create
(
defaults
)
fn
=
m
.
create
(
defaults
)
finally
:
finally
:
...
...
theano/compile/pfunc.py
浏览文件 @
616f8d37
...
@@ -283,7 +283,7 @@ class Param(In):
...
@@ -283,7 +283,7 @@ class Param(In):
def
pfunc
(
params
,
outputs
=
None
,
mode
=
None
,
updates
=
None
,
givens
=
None
,
def
pfunc
(
params
,
outputs
=
None
,
mode
=
None
,
updates
=
None
,
givens
=
None
,
no_default_updates
=
False
,
accept_inplace
=
False
,
name
=
None
,
no_default_updates
=
False
,
accept_inplace
=
False
,
name
=
None
,
rebuild_strict
=
True
,
allow_input_downcast
=
None
,
rebuild_strict
=
True
,
allow_input_downcast
=
None
,
profile
=
None
,
on_unused_input
=
None
,
output_keys
=
None
):
profile
=
None
,
on_unused_input
=
None
,
output_keys
=
None
,
sync
=
False
):
"""
"""
Function-constructor for graphs with shared variables.
Function-constructor for graphs with shared variables.
...
@@ -483,7 +483,7 @@ def pfunc(params, outputs=None, mode=None, updates=None, givens=None,
...
@@ -483,7 +483,7 @@ def pfunc(params, outputs=None, mode=None, updates=None, givens=None,
return
orig_function
(
inputs
,
cloned_outputs
,
mode
,
return
orig_function
(
inputs
,
cloned_outputs
,
mode
,
accept_inplace
=
accept_inplace
,
name
=
name
,
accept_inplace
=
accept_inplace
,
name
=
name
,
profile
=
profile
,
on_unused_input
=
on_unused_input
,
profile
=
profile
,
on_unused_input
=
on_unused_input
,
output_keys
=
output_keys
)
output_keys
=
output_keys
,
sync
=
sync
)
def
_pfunc_param_to_in
(
param
,
strict
=
False
,
allow_downcast
=
None
):
def
_pfunc_param_to_in
(
param
,
strict
=
False
,
allow_downcast
=
None
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论