未验证 提交 2e30134f 编写于 作者: Z zyfncg 提交者: GitHub

Change the invoking method of settiem by Ellipsis and None index from numpy to...

Change the invoking method of settiem by Ellipsis and None index from numpy to set_value op (#34911)

* Change invoking mathod of the settiem by Ellipsis and None index from numpy to set_value op

* add none_axes into attr of set_value_op in dygraph mode
上级 d028214d
......@@ -785,7 +785,8 @@ void BindImperative(py::module *m_ptr) {
const int size = PyTuple_GET_SIZE(index_ptr);
for (int dim = 0; dim < size; ++dim) {
PyObject *slice_item = PyTuple_GetItem(index_ptr, dim);
if (!(PyCheckInteger(slice_item) || PySlice_Check(slice_item))) {
if (!(PyCheckInteger(slice_item) || PySlice_Check(slice_item) ||
slice_item == Py_Ellipsis || slice_item == Py_None)) {
parse_index = false;
break;
}
......@@ -807,7 +808,8 @@ void BindImperative(py::module *m_ptr) {
{"starts", starts},
{"ends", ends},
{"steps", steps},
{"decrease_axes", decrease_axes}};
{"decrease_axes", decrease_axes},
{"none_axes", none_axes}};
imperative::NameVarBaseMap ins = {{"Input", {self}}};
imperative::NameVarBaseMap outs = {{"Out", {self}}};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册