提交 6686a051 authored 作者: Frederic's avatar Frederic

Fix GpuSubtensor for index higher then 2g

上级 d62c7778
...@@ -813,10 +813,10 @@ class Subtensor(Op): ...@@ -813,10 +813,10 @@ class Subtensor(Op):
assert (slicelength <= length); assert (slicelength <= length);
xview_offset += %(c_prefix)s_STRIDES(%(x)s)[outer_ii] * start * xview_offset += (npy_intp)%(c_prefix)s_STRIDES(%(x)s)[outer_ii]
%(strides_mul)s; * start * %(strides_mul)s;
xview_dims[inner_ii] = slicelength; xview_dims[inner_ii] = slicelength;
xview_strides[inner_ii] = %(c_prefix)s_STRIDES(%(x)s)[outer_ii] * step; xview_strides[inner_ii] = (npy_intp)%(c_prefix)s_STRIDES(%(x)s)[outer_ii] * step;
inner_ii += 1; inner_ii += 1;
spec_pos += 3; spec_pos += 3;
...@@ -829,7 +829,7 @@ class Subtensor(Op): ...@@ -829,7 +829,7 @@ class Subtensor(Op):
{ {
if (idx < %(c_prefix)s_DIMS(%(x)s)[outer_ii]) if (idx < %(c_prefix)s_DIMS(%(x)s)[outer_ii])
{ {
xview_offset += %(c_prefix)s_STRIDES(%(x)s)[outer_ii] * idx * xview_offset += (npy_intp)%(c_prefix)s_STRIDES(%(x)s)[outer_ii] * idx *
%(strides_mul)s; %(strides_mul)s;
} }
else else
...@@ -863,7 +863,7 @@ class Subtensor(Op): ...@@ -863,7 +863,7 @@ class Subtensor(Op):
@staticmethod @staticmethod
def helper_c_code_cache_version(): def helper_c_code_cache_version():
return (8,) return (9,)
def c_code(self, node, name, inputs, outputs, sub): # DEBUG def c_code(self, node, name, inputs, outputs, sub): # DEBUG
if not isinstance(node.inputs[0].type, theano.tensor.TensorType): if not isinstance(node.inputs[0].type, theano.tensor.TensorType):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论