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

always enable gpu code

上级 42cca478
...@@ -4419,7 +4419,6 @@ def inc_subtensor(x, y, inplace=False, set_instead_of_inc=False, ...@@ -4419,7 +4419,6 @@ 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.
...@@ -4569,13 +4568,13 @@ class IncSubtensor(Op): ...@@ -4569,13 +4568,13 @@ class IncSubtensor(Op):
out[0] = x out[0] = x
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):
global response # This method delegates much of the work to helper
if response is None: # methods. This method implements the main logic
response = raw_input('Use GPU C code?') # but subclasses may override the helper methods
if response == 'n': # to change the particulars, e.g. GpuIncSubtensor
raise NotImplementedError() # turns the view/copy operations on numpy arrays
assert response == 'y' # into the same operations on cuda arrays.
self.do_type_checking(node) self.do_type_checking(node)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论