diff --git a/include/cppflow/tensor.h b/include/cppflow/tensor.h index 6bca461..4e61c82 100644 --- a/include/cppflow/tensor.h +++ b/include/cppflow/tensor.h @@ -157,6 +157,7 @@ namespace cppflow { TF_TString_Copy(&tstr[0], value.c_str(), value.size()); *this = tensor(static_cast(TF_STRING), (void *) tstr, sizeof(tstr), {}); + TF_TString_Dealloc(&tstr[0]); } #else template<>