From 649d04e82504fb36931a2f2f09bf2554713f6772 Mon Sep 17 00:00:00 2001 From: Wang Rui <55612496+wr-web@users.noreply.github.com> Date: Sat, 9 May 2026 13:12:50 +0800 Subject: [PATCH] Remove incorrect reference count decrement for dim. --- tensorflow/python/eager/pywrap_tensor.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/tensorflow/python/eager/pywrap_tensor.cc b/tensorflow/python/eager/pywrap_tensor.cc index b0d4ef058e5..354292336e3 100644 --- a/tensorflow/python/eager/pywrap_tensor.cc +++ b/tensorflow/python/eager/pywrap_tensor.cc @@ -595,7 +595,6 @@ static PyObject* EagerTensor_shape_tuple(EagerTensor* self) { // Cleanup self->status before returning. TF_SetStatus(self->status, TF_OK, ""); Py_DECREF(shape); - if (dim != nullptr) Py_DECREF(dim); PyErr_SetString(PyExc_RuntimeError, "Error while creating shape"); return nullptr; }