| 3259 | std::vector<PyObject*> objects; |
| 3260 | |
| 3261 | PyObject* ToPyTuple() { |
| 3262 | PyObject* result = PyTuple_New(2); |
| 3263 | |
| 3264 | PyTuple_SET_ITEM(result, 0, GetPythonObjectFromString(str.c_str())); |
| 3265 | |
| 3266 | if (objects.empty()) { |
| 3267 | Py_INCREF(Py_None); |
| 3268 | PyTuple_SET_ITEM(result, 1, Py_None); |
| 3269 | } else { |
| 3270 | PyObject* objects_tuple = PyTuple_New(objects.size()); |
| 3271 | |
| 3272 | for (size_t i = 0; i < objects.size(); i++) { |
| 3273 | PyTuple_SET_ITEM(objects_tuple, i, objects[i]); |
| 3274 | } |
| 3275 | |
| 3276 | PyTuple_SET_ITEM(result, 1, objects_tuple); |
| 3277 | } |
| 3278 | |
| 3279 | return result; |
| 3280 | } |
| 3281 | }; |
| 3282 | |
| 3283 | tensorflow::Status TFE_Py_EncodeTensor(PyObject* arg, |
no test coverage detected