Search code examples
pythoncntk

Thread safety of CNTK evaluation APIs in Python


Documentation here:

https://github.com/Microsoft/CNTK/wiki/CNTK-Eval-Examples#examples-for-evaluating-multiple-requests-in-parallel

...references examples of using CNTK v2 evaluation APIs in thread-safe way in C# and C++. Are Python evaluation APIs thread-safe as well?


Solution

  • Python API should work in the same way as C++/C#: first clone() the Function with parameter sharing, and the concurrent Evaluate() on different Function instances is then thread-safe.