From 304cbf78709edd3d3b51e17b6491355e34b9fadb Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Thu, 22 Oct 2026 14:04:46 -0700 Subject: [PATCH] Release GIL during append calls, similar to the other calls. Otherwise, one might encounter performance issues. PiperOrigin-RevId: 1005039469 --- tensorflow/python/lib/io/file_io_wrapper.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/tensorflow/python/lib/io/file_io_wrapper.cc b/tensorflow/python/lib/io/file_io_wrapper.cc index 0b07e7318c1..a3c043ec594 100644 --- a/tensorflow/python/lib/io/file_io_wrapper.cc +++ b/tensorflow/python/lib/io/file_io_wrapper.cc @@ -237,6 +237,7 @@ PYBIND11_MODULE(_pywrap_file_io, m) { py::arg("filename"), py::arg("mode")) .def("append", [](WritableFile* self, absl::string_view data) { + py::gil_scoped_release release; const auto status = self->Append(data); tensorflow::MaybeRaiseRegisteredFromStatusWithGIL(status); })