提交 4e29b2f7 authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #5469 from abergeron/gpu_advsub1

GpuArray_take1 requires contiguous inputs.
......@@ -19,7 +19,7 @@ except ImportError:
from .type import GpuArrayType, gpu_context_type
from .basic_ops import (as_gpuarray_variable, HideC, GpuKernelBase, Kernel,
infer_context_name)
infer_context_name, gpu_contiguous)
iadd_reg = {}
......@@ -413,7 +413,7 @@ class GpuAdvancedSubtensor1(HideC, tensor.AdvancedSubtensor1):
if ilist__.type.dtype != 'int64':
ilist__ = tensor.cast(ilist__, 'int64')
ilist_ = as_gpuarray_variable(ilist__, ctx_name)
ilist_ = gpu_contiguous(as_gpuarray_variable(ilist__, ctx_name))
if ilist_.type.dtype != 'int64':
raise TypeError('index must be int64')
......
......@@ -7,7 +7,7 @@ from theano import tensor
from theano.compile import DeepCopyOp
from theano.tensor.tests import test_subtensor
from ..basic_ops import HostFromGpu, GpuFromHost
from ..basic_ops import HostFromGpu, GpuFromHost, GpuContiguous
from ..elemwise import GpuDimShuffle
from ..subtensor import (GpuIncSubtensor, GpuSubtensor,
GpuAdvancedSubtensor1,
......@@ -37,7 +37,7 @@ class G_subtensor(test_subtensor.T_subtensor):
# avoid errors with limited devices
dtype='float32',
ignore_topo=(HostFromGpu, GpuFromHost,
DeepCopyOp))
DeepCopyOp, GpuContiguous))
# GPU opt can't run in fast_compile only.
self.fast_compile = False
assert self.sub == GpuSubtensor
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论