Is pytorch C++ API thread safe?

I’ve just tried to make a forward pass of my model in C++ using pytorch’s C++ API using multiple threads.

This led to a bad access error at torch::jit::script::Method::run(). While I will try to create a MCVE for this and check if it’s my fault, I’d highly appreciate if anyone who knows about this could comment.

I made a quick test with just one conv layered network, and it does seem like pytorch c++ api is not thread-safe.