Merge pull request #39104 from gaurav1086:intepreter_memory_leak
PiperOrigin-RevId: 311266368 Change-Id: I817152b28d3ab9b04c34e71dde1ac91dc5b90a32
This commit is contained in:
commit
75507c75e8
@ -609,6 +609,7 @@ PyObject* InterpreterWrapper::GetTensor(int i) const {
|
|||||||
size_t size_of_type;
|
size_t size_of_type;
|
||||||
if (GetSizeOfType(nullptr, tensor->type, &size_of_type) != kTfLiteOk) {
|
if (GetSizeOfType(nullptr, tensor->type, &size_of_type) != kTfLiteOk) {
|
||||||
PyErr_SetString(PyExc_ValueError, "Unknown tensor type.");
|
PyErr_SetString(PyExc_ValueError, "Unknown tensor type.");
|
||||||
|
free(data);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
sparse_buffer_dims[0] = tensor->bytes / size_of_type;
|
sparse_buffer_dims[0] = tensor->bytes / size_of_type;
|
||||||
|
Loading…
Reference in New Issue
Block a user