提交 319e0aae authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix a test in 32bit. We can't make min/max reduction on 0 sized tensor.

上级 1ed8895e
...@@ -1779,7 +1779,8 @@ class AdvancedSubtensor1(Op): ...@@ -1779,7 +1779,8 @@ class AdvancedSubtensor1(Op):
if (i_type != NPY_INTP) { if (i_type != NPY_INTP) {
// Cast %(i_name)s to NPY_INTP (expected by PyArray_TakeFrom), // Cast %(i_name)s to NPY_INTP (expected by PyArray_TakeFrom),
// if all values fit. // if all values fit.
if (!PyArray_CanCastSafely(i_type, NPY_INTP)) { if (!PyArray_CanCastSafely(i_type, NPY_INTP) &&
PyArray_SIZE(%(i_name)s) > 0) {
npy_int64 min_val, max_val; npy_int64 min_val, max_val;
PyObject* py_min_val = PyArray_Min(%(i_name)s, NPY_MAXDIMS, PyObject* py_min_val = PyArray_Min(%(i_name)s, NPY_MAXDIMS,
NULL); NULL);
...@@ -1850,7 +1851,7 @@ class AdvancedSubtensor1(Op): ...@@ -1850,7 +1851,7 @@ class AdvancedSubtensor1(Op):
""" % locals() """ % locals()
def c_code_cache_version(self): def c_code_cache_version(self):
return (0, 1, 1) return (0, 1, 2)
advanced_subtensor1 = AdvancedSubtensor1() advanced_subtensor1 = AdvancedSubtensor1()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论