提交 f08409d9 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Renamed DeepCopiableFunction -> DeepCopyableFunction

上级 55ca1933
...@@ -19,7 +19,7 @@ class Singleton(object): ...@@ -19,7 +19,7 @@ class Singleton(object):
return cls._instance return cls._instance
class DeepCopiableFunction(Singleton): class DeepCopyableFunction(Singleton):
""" """
Utility class to work around Python 2.4 limitations. Utility class to work around Python 2.4 limitations.
...@@ -35,7 +35,7 @@ class DeepCopiableFunction(Singleton): ...@@ -35,7 +35,7 @@ class DeepCopiableFunction(Singleton):
def f(): def f():
return 0 return 0
write instead: write instead:
class F(DeepCopiableFunction): class F(DeepCopyableFunction):
def __call__(self): def __call__(self):
return 0 return 0
f = F() f = F()
......
...@@ -22,7 +22,7 @@ from theano import gof ...@@ -22,7 +22,7 @@ from theano import gof
from theano.gof import Op, utils, Variable, Constant, Type, Apply, Env from theano.gof import Op, utils, Variable, Constant, Type, Apply, Env
from theano.gof.python25 import partial, all, any from theano.gof.python25 import partial, all, any
from theano.configparser import config from theano.configparser import config
from theano.misc.singleton import DeepCopiableFunction from theano.misc.singleton import DeepCopyableFunction
builtin_complex = complex builtin_complex = complex
builtin_int = int builtin_int = int
...@@ -493,13 +493,13 @@ complexs64 = _multi(complex64) ...@@ -493,13 +493,13 @@ complexs64 = _multi(complex64)
complexs128 = _multi(complex128) complexs128 = _multi(complex128)
# Note that currently only upcast_out inherits from DeepCopiableFunction, # Note that currently only upcast_out inherits from DeepCopyableFunction,
# because it is enough to make the test-suite pass with Python 2.4. However, # because it is enough to make the test-suite pass with Python 2.4. However,
# it may prove necessary to use this same mechanism in other places as well # it may prove necessary to use this same mechanism in other places as well
# in the future. # in the future.
# Note that turning a function into an instance of a DeepCopiableFunction # Note that turning a function into an instance of a DeepCopyableFunction
# subclass is backward compatible w.r.t. old pickled files. # subclass is backward compatible w.r.t. old pickled files.
class UpcastOut(DeepCopiableFunction): class UpcastOut(DeepCopyableFunction):
def __call__(self, *types): def __call__(self, *types):
return Scalar(dtype = Scalar.upcast(*types)), return Scalar(dtype = Scalar.upcast(*types)),
upcast_out = UpcastOut() upcast_out = UpcastOut()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论