Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
52090854
提交
52090854
authored
7月 27, 2011
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make the default of Param(...,borrow=None) the same as pfunc.
Also small update to documentation.
上级
59d86606
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
5 行删除
+16
-5
io.py
theano/compile/io.py
+1
-1
pfunc.py
theano/compile/pfunc.py
+15
-4
没有找到文件。
theano/compile/io.py
浏览文件 @
52090854
...
...
@@ -160,7 +160,7 @@ class In(SymbolicInput):
True: permit the compiled function to modify the python object being passed as the input
False: do not permit the compiled function to modify the python object being passed as the input.
borrow: Bool (default: False if
update is None, True if update is not Non
e)
borrow: Bool (default: False if
mutable evaluate to False, True otherwis
e)
True: permit the output of the compiled function to be aliased to the input
False: do not permit any output to be aliased to the input
...
...
theano/compile/pfunc.py
浏览文件 @
52090854
...
...
@@ -9,6 +9,9 @@ from theano.compile import orig_function, In, Out
from
theano.compile.sharedvalue
import
SharedVariable
,
shared
from
theano
import
config
import
logging
_logger
=
logging
.
getLogger
(
"theano.compile.pfunc"
)
def
rebuild_collect_shared
(
outputs
,
inputs
=
None
,
replace
=
None
...
...
@@ -251,7 +254,7 @@ def rebuild_collect_shared( outputs
class
Param
(
object
):
def
__init__
(
self
,
variable
,
default
=
None
,
name
=
None
,
mutable
=
False
,
strict
=
False
,
allow_downcast
=
None
,
implicit
=
None
,
borrow
=
Fals
e
):
strict
=
False
,
allow_downcast
=
None
,
implicit
=
None
,
borrow
=
Non
e
):
"""
:param variable: A variable in an expression graph to use as a compiled-function parameter
...
...
@@ -283,10 +286,18 @@ class Param(object):
self
.
default
=
default
self
.
name
=
name
self
.
mutable
=
mutable
# Mutable implies borrow. You can get borrow = False because of the
# default and it is a bit annoying to require the user to set both
# borrow and mutable to True
# mutable implies the output can be both aliased to the input and that the input can be
# destroyed. borrow simply implies the output can be aliased to the input. Thus
# mutable=True should require borrow=True. Raise warning when borrow is explicitely set
# to False with mutable=True.
if
mutable
:
if
borrow
==
False
:
_logger
.
warning
(
"Symbolic input for variable
%
s (name=
%
s) has "
"flags mutable=True, borrow=False. This combination is "
"incompatible since mutable=True implies that the "
"input variable may be both aliased (borrow=True) and "
"over-written. We set borrow=True and continue."
,
variable
,
name
)
borrow
=
True
self
.
strict
=
strict
self
.
allow_downcast
=
allow_downcast
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论