提交 fac49f83 authored 作者: sebastien's avatar sebastien

Minor changes

上级 79d41307
...@@ -1940,8 +1940,8 @@ class AdvancedIncSubtensor1(Op): ...@@ -1940,8 +1940,8 @@ class AdvancedIncSubtensor1(Op):
""") """)
def c_code(self, node, name, input_names, output_names, sub): def c_code(self, node, name, input_names, output_names, sub):
if float(numpy.__version__[:3]) < 1.75: numpy_ver = [int(n) for n in numpy.__version__.split('.')[:2]]
# This is probably not the best way to do this ... if bool(numpy_ver < [1, 8]):
raise NotImplementedError raise NotImplementedError
x, y, idx = input_names x, y, idx = input_names
out = output_names[0] out = output_names[0]
...@@ -1970,6 +1970,7 @@ class AdvancedIncSubtensor1(Op): ...@@ -1970,6 +1970,7 @@ class AdvancedIncSubtensor1(Op):
} }
PyObject *arglist = Py_BuildValue("OOOi",%(out)s, %(idx)s, %(y)s, %(inc_or_set)d); PyObject *arglist = Py_BuildValue("OOOi",%(out)s, %(idx)s, %(y)s, %(inc_or_set)d);
inplace_increment(NULL, arglist); inplace_increment(NULL, arglist);
Py_XDECREF(arglist);
""" % locals() """ % locals()
def perform(self, node, inp, out_): def perform(self, node, inp, out_):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论