@@ -119,7 +119,7 @@ class TfqNoisySampledExpectationOp : public tensorflow::OpKernel {
119119 NoisyQsimCircuit ());
120120
121121 Status parse_status = ::tensorflow::Status ();
122- auto p_lock = tensorflow::mutex ();
122+ auto p_lock = absl::Mutex ();
123123 auto construct_f = [&](int start, int end) {
124124 for (int i = start; i < end; i++) {
125125 Status local = NoisyQsimCircuitFromProgram (
@@ -273,7 +273,7 @@ class TfqNoisySampledExpectationOp : public tensorflow::OpKernel {
273273 qsim::MultiQubitGateFuser, Simulator>;
274274
275275 const int output_dim_batch_size = output_tensor->dimension (0 );
276- std::vector<tensorflow::mutex > batch_locks (output_dim_batch_size);
276+ std::vector<absl::Mutex > batch_locks (output_dim_batch_size);
277277
278278 const int num_threads = context->device ()
279279 ->tensorflow_cpu_worker_threads ()
@@ -300,7 +300,7 @@ class TfqNoisySampledExpectationOp : public tensorflow::OpKernel {
300300 random_gen.Init (tensorflow::random::New64 (), tensorflow::random::New64 ());
301301
302302 Status compute_status = ::tensorflow::Status ();
303- auto c_lock = tensorflow::mutex ();
303+ auto c_lock = absl::Mutex ();
304304 auto DoWork = [&](int start, int end) {
305305 // Begin simulation.
306306 const auto tfq_for = qsim::SequentialFor (1 );
@@ -374,12 +374,12 @@ class TfqNoisySampledExpectationOp : public tensorflow::OpKernel {
374374 }
375375 if (break_loop) {
376376 // Lock writing to this batch index in output_tensor.
377- batch_locks[i].lock ();
377+ batch_locks[i].Lock ();
378378 for (size_t j = 0 ; j < num_samples[i].size (); j++) {
379379 rolling_sums[j] /= num_samples[i][j];
380380 (*output_tensor)(i, j) += static_cast <float >(rolling_sums[j]);
381381 }
382- batch_locks[i].unlock ();
382+ batch_locks[i].Unlock ();
383383 break ;
384384 }
385385 }
0 commit comments