提交 86b7ae60 authored 作者: sebastien-j's avatar sebastien-j

Initial commit

I tried many things, but they all failed early. Doing this to submit a pull request, as asked by Fred.
上级 f3a80dcb
...@@ -1751,6 +1751,18 @@ class AdvancedIncSubtensor1(Op): ...@@ -1751,6 +1751,18 @@ class AdvancedIncSubtensor1(Op):
return Apply(self, [x_, y_, ilist_], [x_.type()]) return Apply(self, [x_, y_, ilist_], [x_.type()])
def c_code(self, node, name, input_names, output_names, sub):
x, y, idx = input_names
out = output_names[0]
fail = sub['fail']
return """
PyObject *arglist = PyTuple_Pack(3,%(x)s, %(idx)s, %(y)s);
//PyObject *result /*Will be PyNone*/
//result = PyEval_CallObject(inplace_increment, arglist);
//Py_DECREF(arglist)
//Py_DECREF(result)
""" % locals()
def perform(self, node, inp, out_): def perform(self, node, inp, out_):
# TODO opt to make this inplace # TODO opt to make this inplace
x, y, idx = inp x, y, idx = inp
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论