提交 7ea849d0 authored 作者: Frederic Bastien's avatar Frederic Bastien

backport to python 2.4

上级 1329481b
...@@ -4,6 +4,7 @@ __docformat__ = 'restructuredtext en' ...@@ -4,6 +4,7 @@ __docformat__ = 'restructuredtext en'
from theano.gof import Container, Variable, generic, graph, Constant, Value from theano.gof import Container, Variable, generic, graph, Constant, Value
from theano.compile import function, In from theano.compile import function, In
from theano.compile.sandbox.sharedvalue import SharedVariable, shared from theano.compile.sandbox.sharedvalue import SharedVariable, shared
import numpy # for backport to 2.4, to get any().
class Param(object): class Param(object):
def __init__(self, variable, default=None, name=None, mutable=False, strict=False, def __init__(self, variable, default=None, name=None, mutable=False, strict=False,
...@@ -113,7 +114,7 @@ def pfunc(params, outputs=None, mode=None, updates=[], givens=[]): ...@@ -113,7 +114,7 @@ def pfunc(params, outputs=None, mode=None, updates=[], givens=[]):
# used as function inputs. Although it is technically possible, it is also # used as function inputs. Although it is technically possible, it is also
# potentially ambiguous and dangerous. This restriction may be revisited in # potentially ambiguous and dangerous. This restriction may be revisited in
# the future if there is a need for such a feature. # the future if there is a need for such a feature.
if any([isinstance(v, SharedVariable) for v in set_of_param_variables]): if numpy.any([isinstance(v, SharedVariable) for v in set_of_param_variables]):
raise TypeError('Cannot use a shared variable (%s) as explicit input ' raise TypeError('Cannot use a shared variable (%s) as explicit input '
% v) % v)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论