serizba / cppflow

Run TensorFlow models in C++ without installation and without Bazel
https://serizba.github.io/cppflow/
MIT License
779 stars 177 forks source link

Use per model TF_Status instead of the global one #201

Closed ljn917 closed 2 years ago

ljn917 commented 2 years ago

This avoids the initialization order issues when people build cppflow into a library, e.g. a dll.

Should fix #132, #195, #163, #131, #190, #154

ljn917 commented 2 years ago

@serizba I only tested this on Linux (gcc), but many of these issues were reported on Windows related to building into a dll. I am not sure if there is a good way to test it.

serizba commented 2 years ago

Thanks @ljn917

I haven't tried on Windows, but I will merge anyway, as I don't think this PR may create additional problems. People from the related issues can comment if this fixed their errors.