提交 36a1208c authored 作者: Frederic's avatar Frederic

Raise an error if we access sharedvar.value. Otherwise there is a silent bug!

上级 80b00e7f
......@@ -9,6 +9,8 @@ Documentation
(Frédéric B.)
Interface changes
* In 0.5, we removed the deprecated sharedvar.value property.
Now we raise an error if you access it.
* theano.function does not accept duplicate inputs, so function([x, x], ...)
does not work anymore. (Pascal L.)
* theano.function now raises an error if some of the provided inputs are
......
......@@ -139,6 +139,19 @@ class SharedVariable(Variable):
"The generic 'SharedVariable' object is not subscriptable. "
"This shared variable contains %s" % msg)
def _value_get(self):
raise Exception("sharedvar.value don't exist anymore. Use "
"sharedvar.get_value() or sharedvar.get_value()"
" instead.")
def _value_set(self, new_value):
raise Exception("sharedvar.value don't exist anymore. Use "
"sharedvar.get_value() or sharedvar.get_value()"
" instead.")
# We keep this just to raise an error
value = property(_value_get, _value_set),
def shared_constructor(ctor):
shared.constructors.append(ctor)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论