提交 e7feb8e3 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Use the proper way to init T_subtensor.

上级 25ba75cb
...@@ -7,31 +7,20 @@ from theano.sandbox.gpuarray.type import gpuarray_shared_constructor ...@@ -7,31 +7,20 @@ from theano.sandbox.gpuarray.type import gpuarray_shared_constructor
from theano.sandbox.gpuarray.tests.test_basic_ops import mode_with_gpu from theano.sandbox.gpuarray.tests.test_basic_ops import mode_with_gpu
from theano.compile import DeepCopyOp
from theano import tensor from theano import tensor
class G_subtensor(T_subtensor): class G_subtensor(T_subtensor):
def shortDescription(self): def shortDescription(self):
return None return None
shared = staticmethod(gpuarray_shared_constructor)
sub = GpuSubtensor
mode = mode_with_gpu
dtype = 'float32' # avoid errors on gpus which do not support float64
ignore_topo = (HostFromGpu, GpuFromHost)
fast_compile = False
ops = (GpuSubtensor,
tensor.IncSubtensor, tensor.AdvancedSubtensor1,
tensor.AdvancedIncSubtensor1)
#inc_sub = cuda.GpuIncSubtensor
#adv_sub1 = cuda.GpuAdvancedSubtensor1
#adv_incsub1 = cuda.GpuAdvancedIncSubtensor1
inc_sub = tensor.IncSubtensor
adv_sub1 = tensor.AdvancedSubtensor1
adv_incsub1 = tensor.AdvancedIncSubtensor1
def __init__(self, name): def __init__(self, name):
# We must call T_subtensor parten __init__, otherwise, sub is overrieded T_subtensor.__init__(self, name,
ret = super(T_subtensor, self).__init__(name) shared=gpuarray_shared_constructor,
sub=GpuSubtensor,
mode=mode_with_gpu,
# avoid errors with limited devices
dtype='float32',
ignore_topo=(HostFromGpu,GpuFromHost,DeepCopyOp))
assert self.sub == GpuSubtensor assert self.sub == GpuSubtensor
return ret
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论