提交 3bd3ae11 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

fix interface for enabling C code

上级 c1a888a6
...@@ -4381,7 +4381,7 @@ def inc_subtensor(x, y, inplace=False, set_instead_of_inc=False, ...@@ -4381,7 +4381,7 @@ def inc_subtensor(x, y, inplace=False, set_instead_of_inc=False,
else: else:
raise TypeError('x must be result of a subtensor operation') raise TypeError('x must be result of a subtensor operation')
response = None
class IncSubtensor(Op): class IncSubtensor(Op):
"""Increment a subtensor. """Increment a subtensor.
...@@ -4532,10 +4532,12 @@ class IncSubtensor(Op): ...@@ -4532,10 +4532,12 @@ class IncSubtensor(Op):
def c_code(self, node, name, inputs, outputs, sub): def c_code(self, node, name, inputs, outputs, sub):
if not isinstance(node.inputs[0].type, TensorType): if not isinstance(node.inputs[0].type, TensorType):
x = raw_input('Use GPU C code?') global response
if x == 'n': if response is None:
response = raw_input('Use GPU C code?')
if response == 'n':
raise NotImplementedError() raise NotImplementedError()
assert x == 'y' assert response == 'y'
if self.inplace: # convert bool to int if self.inplace: # convert bool to int
inplace = 1 inplace = 1
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论