Skip to content

Commit 01eb8fc

Browse files
committed
follow comments
1 parent 1900be2 commit 01eb8fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

paddle/fluid/pybind/imperative.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ static void ParseIndexingSlice(
428428

429429
// NOTE(zhiqiu): PyTuple_Pack increases refcount.
430430
PyObject *index = !PyTuple_Check(_index) ? PyTuple_Pack(1, _index) : _index;
431-
DEFINE_PADDLE_SCOPE_GUARD([&index, &_index]() {
431+
DEFINE_PADDLE_SCOPE_GUARD([index, _index]() {
432432
if (!PyTuple_Check(_index)) {
433433
Py_DECREF(index);
434434
VLOG(4) << "Call Py_DECREF";
@@ -827,7 +827,7 @@ void BindImperative(py::module *m_ptr) {
827827
PyObject *index_ptr = !PyTuple_Check(_index.ptr())
828828
? PyTuple_Pack(1, _index.ptr())
829829
: _index.ptr();
830-
DEFINE_PADDLE_SCOPE_GUARD([&index_ptr, &_index]() {
830+
DEFINE_PADDLE_SCOPE_GUARD([index_ptr, &_index]() {
831831
if (!PyTuple_Check(_index.ptr())) {
832832
Py_DECREF(index_ptr);
833833
VLOG(4) << "Call Py_DECREF";

0 commit comments

Comments
 (0)