tflite-micro/tensorflow/lite/micro/python
Pauline Sho c478145e83
Fix Python interpreter destructor bug and disable invoke exception (#1254)
BUG=b/239225101

In the current Python interpreter, we do Py_DECREF(model_) in the body destructor of
InterpreterWrapper, which will be called first before member variables' destructors. This causes
an issue because destructing the MicroInterpreter (namely FreeSubgraphs) relies on some parts of
model_. This means that when the destructor of MicroInterpreter is called, the model may have
already been released, causing a segfault.

We can bypass this by not using a unique pointer for MicroInterpreter, and simply delete
interpreter_ before we call Py_DECREF(model_).

BUG=b/238459185

Some error codes are expected, such as cycles_until_run in the circular buffer op. The interpreter
wrapper shouldn't throw any exception in Python when invoke returns an error.
2022-07-15 22:12:21 +00:00
..
interpreter Fix Python interpreter destructor bug and disable invoke exception (#1254) 2022-07-15 22:12:21 +00:00
tflite_size Removed a simple typo. (#1247) 2022-07-12 23:57:25 +00:00