提交 d2aef4d9 authored 作者: Frederic Bastien's avatar Frederic Bastien

remove other trace of _op_use_c_code

上级 b60d0390
......@@ -781,17 +781,6 @@ class Op(utils.object2, PureOp, CLinkerOp):
Convenience class to bundle `PureOp` and `CLinkerOp`.
"""
def __new__(cls, *args, **kwargs):
# this function exists to silently and transparently ensure that all
# existing Ops get a _op_use_c_code attribute
obj = object.__new__(cls)
if not hasattr(obj, '_op_use_c_code'):
obj._op_use_c_code = theano.config.cxx
return obj
def __init__(self, use_c_code=theano.config.cxx):
self._op_use_c_code = use_c_code
def prepare_node(self, node, storage_map, compute_map, impl):
"""
Make any special modifications that the Op needs before doing
......
......@@ -541,10 +541,8 @@ class GpuGemm(GpuOp):
def __setstate__(self, dct):
self.__dict__.update(dct)
# Correctly reload older pickles where _op_use_c_code and
# destroy_map were not saved
if '_op_use_c_code' not in self.__dict__:
self._op_use_c_code = theano.config.cxx
# Correctly reload older pickles where destroy_map were not
# saved
if 'destroy_map' not in self.__dict__ and self.inplace:
self.destroy_map = {0: [0]}
......@@ -661,10 +659,8 @@ class GpuGemv(GpuOp):
def __setstate__(self, dct):
self.__dict__.update(dct)
# Correctly reload older pickles where _op_use_c_code and
# destroy_map were not saved
if '_op_use_c_code' not in self.__dict__:
self._op_use_c_code = theano.config.cxx
# Correctly reload older pickles where destroy_map were not
# saved
if 'destroy_map' not in self.__dict__ and self.inplace:
self.destroy_map = {0: [0]}
......@@ -761,10 +757,8 @@ class GpuGer(GpuOp):
def __setstate__(self, dct):
self.__dict__.update(dct)
# Correctly reload older pickles where _op_use_c_code and
# destroy_map were not saved
if '_op_use_c_code' not in self.__dict__:
self._op_use_c_code = theano.config.cxx
# Correctly reload older pickles where destroy_map were not
# saved
if 'destroy_map' not in self.__dict__ and self.inplace:
self.destroy_map = {0: [0]}
......
......@@ -834,10 +834,8 @@ class Gemm(GemmRelated):
else:
self.setup_z_Nz_Sz = self.setup_z_Nz_Sz_outplace
# Correctly reload older pickles where _op_use_c_code and
# destroy_map were not saved
if '_op_use_c_code' not in self.__dict__:
self._op_use_c_code = theano.config.cxx
# Correctly reload older pickles where destroy_map were not
# saved
if 'destroy_map' not in self.__dict__ and self.inplace:
self.destroy_map = {0: [0]}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论