message: kanvi/ssd_vgg16_bug
  * Add mutex to safeguard the Compute function which can be called
  by multiple threads at the same time causing crash as seen in
  the ssd_vgg16 model.
diff: *******************************************************************************/
  #include <cstdlib>
  #include <fstream>
  +#include <mutex>
  #include <utility>
  #include "tensorflow/core/common_runtime/dma_helper.h"
  @@ -221,6 +222,7 @@ class NGraphEncapsulateOp : public OpKernel {
  // TODO(amprocte): this needs to be made thread-safe (compilation cache OK?).
  void Compute(OpKernelContext* ctx) override {
  + std::lock_guard<std::mutex> lock{m_compute_lock};
  NGRAPH_VLOG(4) << "NGraphEncapsulateOp::Compute starting for cluster "
  << m_ngraph_cluster;
  @@ -530,6 +532,7 @@ class NGraphEncapsulateOp : public OpKernel {
  static std::string s_ng_backend_name;
  static mutex s_ng_backend_mutex;
  + std::mutex m_compute_lock;
  };
  std::weak_ptr<ng::runtime::Backend> NGraphEncapsulateOp::s_ng_backend_wptr;
  