提交 68290a96 authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #4606 from nouiz/fix_crash

Fix crash
...@@ -1929,13 +1929,13 @@ class AdvancedIncSubtensor1(Op): ...@@ -1929,13 +1929,13 @@ class AdvancedIncSubtensor1(Op):
""" """
# Parameters of PyArrary_FromAny are: # Parameters of PyArrary_FromAny are:
# array # array
# dtype: NULL mean any dtype is acceptable. # dtype: we pass NULL to say any dtype is acceptable, so the existing
# We force the dtype to try to fix a Windows problem. # dtype will be copied
# min_depth: we pass 0 to have this parameter ignored # min_depth: we pass 0 to have this parameter ignored
# max_depth: we pass 0 to have this parameter ignored # max_depth: we pass 0 to have this parameter ignored
# requirements: here we pass NPY_ARRAY_ENSURECOPY to force a copy # requirements: here we pass NPY_ARRAY_ENSURECOPY to force a copy
# context: this is almost always NULL, I'm not sure what it's used for # context: this is almost always NULL, I'm not sure what it's used for
return """(PyArrayObject*)PyArray_FromAny(py_%(x)s, PyArray_DTYPE(%(x)s), 0, 0, return """(PyArrayObject*)PyArray_FromAny(py_%(x)s, NULL, 0, 0,
NPY_ARRAY_ENSURECOPY, NULL)""" % locals() NPY_ARRAY_ENSURECOPY, NULL)""" % locals()
def c_support_code(self): def c_support_code(self):
...@@ -1982,7 +1982,7 @@ class AdvancedIncSubtensor1(Op): ...@@ -1982,7 +1982,7 @@ class AdvancedIncSubtensor1(Op):
""" % locals() """ % locals()
def c_code_cache_version(self): def c_code_cache_version(self):
return (2,) return (3,)
def perform(self, node, inp, out_): def perform(self, node, inp, out_):
# TODO opt to make this inplace # TODO opt to make this inplace
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论