提交 08cf79e4 authored 作者: Frederic's avatar Frederic

Set the Op._op_use_c_code attribute to theano.config.cxx by default.

上级 5344b115
...@@ -1453,7 +1453,8 @@ class OpWiseCLinker(link.LocalLinker): ...@@ -1453,7 +1453,8 @@ class OpWiseCLinker(link.LocalLinker):
# make_thunk # make_thunk
old_value = getattr(node.op, '_op_use_c_code', False) old_value = getattr(node.op, '_op_use_c_code', False)
try: try:
node.op._op_use_c_code = True if theano.config.cxx:
node.op._op_use_c_code = True
thunks += [node.op.make_thunk(node, thunks += [node.op.make_thunk(node,
storage_map, storage_map,
compute_map, compute_map,
......
...@@ -530,10 +530,10 @@ class Op(utils.object2, PureOp, CLinkerOp): ...@@ -530,10 +530,10 @@ class Op(utils.object2, PureOp, CLinkerOp):
# existing Ops get a _op_use_c_code attribute # existing Ops get a _op_use_c_code attribute
obj = object.__new__(cls) obj = object.__new__(cls)
if not hasattr(obj, '_op_use_c_code'): if not hasattr(obj, '_op_use_c_code'):
obj._op_use_c_code = True obj._op_use_c_code = theano.config.cxx
return obj return obj
def __init__(self, use_c_code=True): def __init__(self, use_c_code=theano.config.cxx):
self._op_use_c_code = use_c_code self._op_use_c_code = use_c_code
def make_thunk(self, node, storage_map, compute_map, no_recycling): def make_thunk(self, node, storage_map, compute_map, no_recycling):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论