Replace `tensorflow::Status::OK()` with tensorflow::OkStatus()`.

PiperOrigin-RevId: 455002533
diff --git a/tensorflow/c/c_api.cc b/tensorflow/c/c_api.cc
index db3a2fc..7a7149c 100644
--- a/tensorflow/c/c_api.cc
+++ b/tensorflow/c/c_api.cc
@@ -187,7 +187,7 @@
 }
 
 void TF_DeleteDeprecatedSession(TF_DeprecatedSession* s, TF_Status* status) {
-  status->status = Status::OK();
+  status->status = ::tensorflow::OkStatus();
   if (s == nullptr) return;
   delete s->session;
   delete s;
@@ -249,7 +249,7 @@
   out->data = buf;
   out->length = proto_size;
   out->data_deallocator = [](void* data, size_t length) { port::Free(data); };
-  return Status::OK();
+  return OkStatus();
 }
 
 Status BufferToMessage(const TF_Buffer* in,
@@ -258,7 +258,7 @@
     return errors::InvalidArgument("Unparseable ", out->GetTypeName(),
                                    " proto");
   }
-  return Status::OK();
+  return OkStatus();
 }
 
 void RecordMutation(TF_Graph* graph, const TF_Operation& op,
@@ -393,7 +393,7 @@
 
 static void TF_Run_Setup(int noutputs, TF_Tensor** c_outputs,
                          TF_Status* status) {
-  status->status = Status::OK();
+  status->status = ::tensorflow::OkStatus();
   for (int i = 0; i < noutputs; ++i) {
     c_outputs[i] = nullptr;
   }
@@ -429,9 +429,9 @@
       return InvalidArgument(
           "Malformed TF_RESOURCE tensor: unable to parse resource handle");
     }
-    return Status::OK();
+    return ::tensorflow::OkStatus();
   }
-  return Status::OK();
+  return ::tensorflow::OkStatus();
 }
 
 static bool TF_Run_Inputs(TF_Tensor* const* c_inputs,
@@ -675,7 +675,7 @@
       status->status = InvalidArgument("index out of bounds");            \
       return err_val;                                                     \
     }                                                                     \
-    status->status = Status::OK();                                        \
+    status->status = ::tensorflow::OkStatus();                            \
     return list->response[index].accessor;                                \
   }
 
@@ -1000,7 +1000,7 @@
   TensorShapeProto shape;
   if (shape.ParseFromArray(proto, static_cast<int>(proto_len))) {
     desc->node_builder.Attr(attr_name, shape);
-    status->status = Status::OK();
+    status->status = ::tensorflow::OkStatus();
   } else {
     status->status = InvalidArgument("Unparseable TensorShapeProto");
   }
@@ -1027,7 +1027,7 @@
     }
   }
   desc->node_builder.Attr(attr_name, shapes);
-  status->status = Status::OK();
+  status->status = ::tensorflow::OkStatus();
 }
 
 void TF_SetAttrTensor(TF_OperationDescription* desc, const char* attr_name,
@@ -1040,7 +1040,7 @@
 void TF_SetAttrTensorList(TF_OperationDescription* desc, const char* attr_name,
                           TF_Tensor* const* values, int num_values,
                           TF_Status* status) {
-  status->status = Status::OK();
+  status->status = ::tensorflow::OkStatus();
   std::vector<Tensor> t;
   t.reserve(num_values);
 
@@ -1078,7 +1078,7 @@
     desc->node_builder.Attr(attr_name, std::move(attr_value));
   }
 
-  status->status = Status::OK();
+  status->status = ::tensorflow::OkStatus();
 }
 
 TF_Operation* TF_FinishOperationLocked(TF_OperationDescription* desc,
@@ -1593,7 +1593,7 @@
   for (it = attrs.begin(); it != attrs.end(); it++) {
     if (count == i) {
       strncpy(output, it->first.c_str(), it->first.length());
-      status->status = Status::OK();
+      status->status = ::tensorflow::OkStatus();
       return;
     }
     count++;
@@ -1957,7 +1957,7 @@
   for (const auto& pair : results.return_tensors) {
     return_nodes->emplace_back(pair.first, pair.second);
   }
-  return Status::OK();
+  return ::tensorflow::OkStatus();
 }
 
 bool ValidateConstWhileParams(const TF_WhileParams& params, TF_Status* s) {
@@ -2089,7 +2089,7 @@
             scope.impl()->control_deps(), &params->cond_output,
             /* nreturn_nodes */ 1, &cond_output));
         *output = cond_output[0];
-        return Status::OK();
+        return ::tensorflow::OkStatus();
       };
 
   // 'body_fn' copies the body graph into the parent graph.
@@ -2104,7 +2104,7 @@
                       &parent->refiner, params->body_inputs, inputs,
                       scope.impl()->name(), scope.impl()->control_deps(),
                       params->body_outputs, num_loop_vars, outputs));
-        return Status::OK();
+        return ::tensorflow::OkStatus();
       };
 
   // Create the while loop using an internal scope.
@@ -2338,7 +2338,7 @@
 }
 
 void TF_DeleteSession(TF_Session* s, TF_Status* status) {
-  status->status = Status::OK();
+  status->status = ::tensorflow::OkStatus();
   if (s == nullptr) return;
   TF_Graph* const graph = s->graph;
   if (graph != nullptr) {
@@ -2497,7 +2497,7 @@
     status->status = InvalidArgument("Unparseable OpList");
     return nullptr;
   }
-  status->status = Status::OK();
+  status->status = ::tensorflow::OkStatus();
   return new TF_ApiDefMap(op_list);
 }
 
diff --git a/tensorflow/c/c_api_experimental.cc b/tensorflow/c/c_api_experimental.cc
index 066f418..fa196be 100644
--- a/tensorflow/c/c_api_experimental.cc
+++ b/tensorflow/c/c_api_experimental.cc
@@ -500,7 +500,7 @@
   tensorflow::Tensor tensor(dtype, tensorflow::TensorShape({}));
   std::memcpy(tensorflow::TensorCApi::Buffer(tensor)->data(), data, len);
 
-  status->status = tensorflow::Status::OK();
+  status->status = ::tensorflow::OkStatus();
   return tensorflow::wrap(tensorflow::TensorHandle::CreateLocalHandle(tensor));
 }
 
diff --git a/tensorflow/c/c_api_function.cc b/tensorflow/c/c_api_function.cc
index f03e52a..5507e5b 100644
--- a/tensorflow/c/c_api_function.cc
+++ b/tensorflow/c/c_api_function.cc
@@ -40,7 +40,7 @@
   return IsRefType(dt)
              ? InvalidArgument("Output ", idx, " of node '", node->name(),
                                "' has a reference type ", DataTypeString(dt))
-             : Status::OK();
+             : OkStatus();
 }
 
 // Converts `ninputs` and `inputs` into `inputs_tensors` and `input_nodes` and
@@ -79,7 +79,7 @@
       indices.push_back(idx);
     }
   }
-  return Status::OK();
+  return OkStatus();
 }
 
 // Converts `noutputs` and `outputs` into `outputs_tensors` and does various
@@ -101,7 +101,7 @@
                                     fn_name, "'");
     output_tensors->emplace_back(node, idx);
   }
-  return Status::OK();
+  return OkStatus();
 }
 
 // Populates `body_nodes` with the nodes that will become function's body.
@@ -138,7 +138,7 @@
       body_nodes->push_back(node);
     }
   }
-  return Status::OK();
+  return OkStatus();
 }
 
 }  // namespace
@@ -281,7 +281,7 @@
     func->fdef = lib.function(i);
     funcs[i] = func;
   }
-  status->status = tensorflow::Status::OK();
+  status->status = ::tensorflow::OkStatus();
   return len;
 }
 
@@ -299,7 +299,7 @@
     TF_DeleteFunction(func);
     return nullptr;
   }
-  status->status = tensorflow::Status::OK();
+  status->status = ::tensorflow::OkStatus();
   return func;
 }
 
@@ -314,7 +314,7 @@
     return;
   }
   (*func->fdef.mutable_attr())[string(attr_name)] = attr_value;
-  status->status = tensorflow::Status::OK();
+  status->status = ::tensorflow::OkStatus();
 }
 
 void TF_FunctionGetAttrValueProto(TF_Function* func, const char* attr_name,
diff --git a/tensorflow/c/c_api_test.cc b/tensorflow/c/c_api_test.cc
index 9061501..7d191fb 100644
--- a/tensorflow/c/c_api_test.cc
+++ b/tensorflow/c/c_api_test.cc
@@ -246,7 +246,7 @@
 
     // Convert back to a C++ Tensor and ensure we get expected output.
     Tensor output;
-    ASSERT_EQ(Status::OK(), TF_TensorToTensor(dst, &output)) << line;
+    ASSERT_EQ(OkStatus(), TF_TensorToTensor(dst, &output)) << line;
     ASSERT_EQ(src.NumElements(), output.NumElements()) << line;
     for (int64_t i = 0; i < src.NumElements(); ++i) {
       ASSERT_EQ(data[i], output.flat<tstring>()(i)) << line;
diff --git a/tensorflow/c/experimental/gradients/array_grad.cc b/tensorflow/c/experimental/gradients/array_grad.cc
index 5e6c3a4..e941cd6 100644
--- a/tensorflow/c/experimental/gradients/array_grad.cc
+++ b/tensorflow/c/experimental/gradients/array_grad.cc
@@ -33,7 +33,7 @@
       }
       grad_inputs[i] = grad_input;
     }
-    return Status::OK();
+    return OkStatus();
   }
   ~IdentityNGradientFunction() override {}
 };
diff --git a/tensorflow/c/experimental/gradients/array_grad_test.cc b/tensorflow/c/experimental/gradients/array_grad_test.cc
index b3488d3..61c0bce 100644
--- a/tensorflow/c/experimental/gradients/array_grad_test.cc
+++ b/tensorflow/c/experimental/gradients/array_grad_test.cc
@@ -41,7 +41,7 @@
   // for computing gradient so we could safely drop it.
   outputs[0] = temp_outputs[1];
   temp_outputs[0]->Unref();
-  return Status::OK();
+  return OkStatus();
 }
 
 class CppGradients
diff --git a/tensorflow/c/experimental/gradients/custom_gradient_test.cc b/tensorflow/c/experimental/gradients/custom_gradient_test.cc
index 4c901a0..d447073 100644
--- a/tensorflow/c/experimental/gradients/custom_gradient_test.cc
+++ b/tensorflow/c/experimental/gradients/custom_gradient_test.cc
@@ -53,7 +53,7 @@
     if (grad_inputs[0]) {
       grad_inputs[0]->Ref();
     }
-    return Status::OK();
+    return OkStatus();
   }
 };
 
@@ -81,7 +81,7 @@
                                           /*output_gradients=*/{},
                                           /*result=*/outputs));
   exp_output->Unref();
-  return Status::OK();
+  return OkStatus();
 }
 
 TEST_P(CustomGradientTest, ExpWithPassThroughGrad) {
diff --git a/tensorflow/c/experimental/gradients/grad_test_helper.cc b/tensorflow/c/experimental/gradients/grad_test_helper.cc
index a7b47fa..1bcb721 100644
--- a/tensorflow/c/experimental/gradients/grad_test_helper.cc
+++ b/tensorflow/c/experimental/gradients/grad_test_helper.cc
@@ -127,7 +127,7 @@
     for (auto temp_output : temp_outputs) {
       temp_output->Unref();
     }
-    return Status::OK();
+    return OkStatus();
   };
 }
 
diff --git a/tensorflow/c/experimental/gradients/math_grad.cc b/tensorflow/c/experimental/gradients/math_grad.cc
index 0d9d3e9..06f6d67 100644
--- a/tensorflow/c/experimental/gradients/math_grad.cc
+++ b/tensorflow/c/experimental/gradients/math_grad.cc
@@ -61,7 +61,7 @@
 
     grad_inputs[0]->Ref();
     grad_inputs[1]->Ref();
-    return Status::OK();
+    return OkStatus();
   }
   ~AddGradientFunction() override {}
 };
@@ -82,7 +82,7 @@
     name = "Mul_Exp_Grad";
     TF_RETURN_IF_ERROR(
         Mul(ctx, conj_output, grad_outputs[0], &grad_inputs[0], name.c_str()));
-    return Status::OK();
+    return OkStatus();
   }
   ~ExpGradientFunction() override {}
 
@@ -101,7 +101,7 @@
     std::string name = "Sqrt_Grad";
     TF_RETURN_IF_ERROR(SqrtGrad(ctx, sqrt_.get(), grad_outputs[0],
                                 &grad_inputs[0], name.c_str()));
-    return Status::OK();
+    return OkStatus();
   }
   ~SqrtGradientFunction() override {}
 
@@ -199,7 +199,7 @@
 
     // Gradient for B
     grad_inputs[1] = matmul_B_output;
-    return Status::OK();
+    return OkStatus();
   }
   ~MatMulGradientFunction() override {
     for (auto input : forward_inputs_) {
@@ -229,7 +229,7 @@
     std::string name = "Neg_Grad";
     TF_RETURN_IF_ERROR(
         ops::Neg(ctx, grad_outputs[0], &grad_inputs[0], name.c_str()));
-    return Status::OK();
+    return OkStatus();
   }
   ~NegGradientFunction() override {}
 };
@@ -257,7 +257,7 @@
     TF_RETURN_IF_ERROR(
         ops::Neg(ctx, grad_outputs[0], &grad_inputs[1], name.c_str()));
 
-    return Status::OK();
+    return OkStatus();
   }
   ~SubGradientFunction() override {}
 };
@@ -294,7 +294,7 @@
     name = "Mul_Grad_B";
     TF_RETURN_IF_ERROR(Mul(ctx, forward_inputs_[0], upstream_grad,
                            &grad_inputs[1], name.c_str()));
-    return Status::OK();
+    return OkStatus();
   }
   ~MulGradientFunction() override {
     for (auto input : forward_inputs_) {
@@ -359,7 +359,7 @@
     TF_RETURN_IF_ERROR(
         Div(ctx, upstream_grad, Conj_XP1.get(), &grad_inputs[0], name.c_str()));
 
-    return Status::OK();
+    return OkStatus();
   }
   ~Log1pGradientFunction() override {
     for (auto input : forward_inputs_) {
@@ -427,7 +427,7 @@
     TF_RETURN_IF_ERROR(DivNoNan(ctx, UZ.get(), Y, &grad_inputs[1],
                                 name.c_str()));  // -U*Z / Y
 
-    return Status::OK();
+    return OkStatus();
   }
   ~DivNoNanGradientFunction() override {
     for (auto input : forward_inputs_) {
diff --git a/tensorflow/c/experimental/gradients/nn_grad.cc b/tensorflow/c/experimental/gradients/nn_grad.cc
index 5529f70..bf8943b 100644
--- a/tensorflow/c/experimental/gradients/nn_grad.cc
+++ b/tensorflow/c/experimental/gradients/nn_grad.cc
@@ -54,7 +54,7 @@
     std::string name = "relu_grad";
     TF_RETURN_IF_ERROR(ReluGrad(ctx, upstream_grad, activations,
                                 &grad_inputs[0], name.c_str()));
-    return Status::OK();
+    return OkStatus();
   }
   ~ReluGradientFunction() override {
     for (auto output : forward_outputs_) {
@@ -86,7 +86,7 @@
   TF_RETURN_IF_ERROR(
       ops::Mul(ctx, expand_dims_outputs, mat, &outputs[0], "Mul"));
   expand_dims_outputs->Unref();
-  return Status::OK();
+  return OkStatus();
 }
 
 class SparseSoftmaxCrossEntropyWithLogitsGradientFunction
@@ -106,7 +106,7 @@
 
     // Grad for labels is null
     grad_inputs[1] = nullptr;
-    return Status::OK();
+    return OkStatus();
   }
   ~SparseSoftmaxCrossEntropyWithLogitsGradientFunction() override {}
 
@@ -145,7 +145,7 @@
     TF_RETURN_IF_ERROR(BiasAddGrad(ctx, upstream_grad, &grad_inputs[1],
                                    data_format.c_str(), name.c_str()));
 
-    return Status::OK();
+    return OkStatus();
   }
   ~BiasAddGradientFunction() override {}
 
diff --git a/tensorflow/c/experimental/gradients/nn_grad_test.cc b/tensorflow/c/experimental/gradients/nn_grad_test.cc
index 2e82cd4..15552ee 100644
--- a/tensorflow/c/experimental/gradients/nn_grad_test.cc
+++ b/tensorflow/c/experimental/gradients/nn_grad_test.cc
@@ -50,7 +50,7 @@
   // it.
   outputs[0] = loss;
   backprop->Unref();
-  return Status::OK();
+  return OkStatus();
 }
 
 Status BiasAddModel(AbstractContext* ctx,
diff --git a/tensorflow/c/experimental/gradients/not_differentiable.cc b/tensorflow/c/experimental/gradients/not_differentiable.cc
index e8dbb7e..4f3bd1f 100644
--- a/tensorflow/c/experimental/gradients/not_differentiable.cc
+++ b/tensorflow/c/experimental/gradients/not_differentiable.cc
@@ -22,7 +22,7 @@
   for (int i = 0; i < grad_inputs.size(); i++) {
     grad_inputs[i] = nullptr;
   }
-  return Status::OK();
+  return OkStatus();
 }
 
 Status RegisterNotDifferentiable(GradientRegistry* registry, const string& op) {
diff --git a/tensorflow/c/kernels_experimental.cc b/tensorflow/c/kernels_experimental.cc
index 56722dd..5a9f900 100644
--- a/tensorflow/c/kernels_experimental.cc
+++ b/tensorflow/c/kernels_experimental.cc
@@ -59,7 +59,7 @@
     tensorflow::Var* var) {
   auto* context = reinterpret_cast<::tensorflow::OpKernelContext*>(ctx);
   if (var->copy_on_read_mode.load()) {
-    return Status::OK();
+    return ::tensorflow::OkStatus();
   }
   mutex_lock ml(*var->mu());
   // Once copy-on-read mode is True the refcount is guaranteed to be 1. This can
@@ -67,7 +67,7 @@
   // copy-on-read mode is false.
   if (var->tensor()->RefCountIsOne()) {
     var->copy_on_read_mode.store(true);
-    return Status::OK();
+    return ::tensorflow::OkStatus();
   }
   Tensor tmp;
   if (variantType) {
@@ -94,7 +94,7 @@
   }
   *var->tensor() = tmp;
   var->copy_on_read_mode.store(true);
-  return Status::OK();
+  return ::tensorflow::OkStatus();
 }
 
 tensorflow::Status PrepareToUpdateVariable(
@@ -131,7 +131,7 @@
     }
     *tensor = tmp;
   }
-  return Status::OK();
+  return ::tensorflow::OkStatus();
 }
 
 tensorflow::mutex* GetTrainingVariableMutex(
@@ -172,7 +172,7 @@
                                *ptr = new tensorflow::Var(value.dtype());
                                *(*ptr)->tensor() = value;
                                (*ptr)->is_initialized = true;
-                               return tensorflow::Status::OK();
+                               return ::tensorflow::OkStatus();
                              }));
   tensorflow::mutex_lock ml(*variable->mu());
 
diff --git a/tensorflow/c/tf_status.cc b/tensorflow/c/tf_status.cc
index 0d07279..2f774fa 100644
--- a/tensorflow/c/tf_status.cc
+++ b/tensorflow/c/tf_status.cc
@@ -29,7 +29,7 @@
 
 void TF_SetStatus(TF_Status* s, TF_Code code, const char* msg) {
   if (code == TF_OK) {
-    s->status = Status::OK();
+    s->status = ::tensorflow::OkStatus();
     return;
   }
   s->status = Status(static_cast<Code>(code), tensorflow::StringPiece(msg));
diff --git a/tensorflow/c/tf_tensor.cc b/tensorflow/c/tf_tensor.cc
index d23a647..1804fe8 100644
--- a/tensorflow/c/tf_tensor.cc
+++ b/tensorflow/c/tf_tensor.cc
@@ -241,7 +241,7 @@
 
 Status TensorInterface::FromProto(const tensorflow::TensorProto& from) {
   bool success = tensor_.FromProto(from);
-  if (success) return Status::OK();
+  if (success) return OkStatus();
   return errors::InvalidArgument("Unparseable tensor proto");
 }
 
@@ -277,7 +277,7 @@
 
 // Non-static for testing.
 TF_Tensor* TF_TensorFromTensor(const tensorflow::Tensor& src, Status* status) {
-  *status = tensorflow::Status::OK();
+  *status = OkStatus();
   if (!src.IsInitialized()) {
     *status = FailedPrecondition(
         "attempt to use a tensor with an uninitialized value");
@@ -301,7 +301,7 @@
 
 Status TensorInterface::ToTensor(tensorflow::Tensor* dst) const {
   *dst = tensor_;
-  return Status::OK();
+  return OkStatus();
 }
 
 bool TensorInterface::IsAligned() const { return tensor_.IsAligned(); }
diff --git a/tensorflow/compiler/xrt/xrt_compilation_cache.cc b/tensorflow/compiler/xrt/xrt_compilation_cache.cc
index d7cb4fa..ea856ba 100644
--- a/tensorflow/compiler/xrt/xrt_compilation_cache.cc
+++ b/tensorflow/compiler/xrt/xrt_compilation_cache.cc
@@ -99,7 +99,7 @@
           << (cache_.size() - entries_by_last_use_.size()) << " entries ("
           << marked_for_eviction_entries_ << ").";
 
-  return Status::OK();
+  return OkStatus();
 }
 
 void XRTCompilationCache::DiscardEntryRef(CompiledSubgraph* entry) {
@@ -279,7 +279,7 @@
   CompiledSubgraph* cache_entry = iter->second;
   *entry = std::unique_ptr<XRTCompilationCacheEntryRef>(
       new EntryRefImpl(this, cache_entry));
-  return Status::OK();
+  return OkStatus();
 }
 
 string XRTCompilationCache::DebugString() const {
@@ -296,7 +296,7 @@
       rm->default_container(), kXRTCompilationCacheResourceName, &cache,
       [&](XRTCompilationCache** new_cache) {
         *new_cache = new XRTCompilationCache(max_number_of_entries);
-        return Status::OK();
+        return OkStatus();
       }));
   return RefPtr<XRTCompilationCache>(cache);
 }
diff --git a/tensorflow/compiler/xrt/xrt_device.cc b/tensorflow/compiler/xrt/xrt_device.cc
index 4cc6a51..65bfa3ed 100644
--- a/tensorflow/compiler/xrt/xrt_device.cc
+++ b/tensorflow/compiler/xrt/xrt_device.cc
@@ -57,7 +57,7 @@
   const XlaDevice::Metadata* metadata;
   TF_RETURN_IF_ERROR(XlaDevice::GetMetadata(ctx, &metadata));
   *rm = ResourceMgrArena::Get()->GetResourceMgr(metadata->platform()->Name());
-  return Status::OK();
+  return OkStatus();
 }
 
 /* static */ xla::StatusOr<RefPtr<XRTCompilationCache>>
@@ -79,7 +79,7 @@
   }
   scoped_ref->Acquire(metadata->client(), device_ordinal,
                       metadata->platform()->Name(), ctx);
-  return Status::OK();
+  return OkStatus();
 }
 
 /*static*/ Status XRTGenericDeviceAccessor::InitScopedRef(
@@ -88,7 +88,7 @@
   TF_RETURN_IF_ERROR(XlaDevice::GetMetadata(ctx, &metadata));
   scoped_ref->Acquire(metadata->client(), metadata->device_ordinal(),
                       metadata->platform()->Name(), ctx);
-  return Status::OK();
+  return OkStatus();
 }
 
 /* static */ tensorflow::mutex
diff --git a/tensorflow/compiler/xrt/xrt_memory_manager.cc b/tensorflow/compiler/xrt/xrt_memory_manager.cc
index 6d5a35b..00dad57 100644
--- a/tensorflow/compiler/xrt/xrt_memory_manager.cc
+++ b/tensorflow/compiler/xrt/xrt_memory_manager.cc
@@ -203,7 +203,7 @@
   TF_RETURN_IF_ERROR(
       tuple->PinAndSwapIn(memory_manager_.get(), backend, allocator).status());
   pinned_tuples_.push_back(std::move(tuple));
-  return Status::OK();
+  return OkStatus();
 }
 
 /* static */ RefPtr<XRTMemoryManager> XRTMemoryManager::Get(ResourceMgr* rm) {
@@ -213,7 +213,7 @@
   TF_CHECK_OK(rm->LookupOrCreate<XRTMemoryManager>(
       *container, *name, &memory_manager, [](XRTMemoryManager** ret) {
         *ret = new XRTMemoryManager();
-        return Status::OK();
+        return OkStatus();
       }));
   return memory_manager;
 }
@@ -246,7 +246,7 @@
   if (device_context == nullptr || !device_context->Release(handle)) {
     return errors::NotFound("XRT memory handle not found: ", handle);
   }
-  return Status::OK();
+  return OkStatus();
 }
 
 Status XRTMemoryManager::CompactAllocations(
@@ -256,7 +256,7 @@
                                                    /*create_if_missing=*/false);
   return device_context != nullptr
              ? device_context->CompactAllocations(this, backend, allocator)
-             : Status::OK();
+             : OkStatus();
 }
 
 void XRTMemoryManager::ReleaseAllAllocations() {
@@ -348,7 +348,7 @@
       size_t size = free_size_or.ValueOrDie();
       mrctx->free_size += size;
       if (size > 0) {
-        return Status::OK();
+        return OkStatus();
       }
     }
     mrctx->done_freeing = true;
@@ -358,7 +358,7 @@
     if (device_context
             ->CompactAllocations(this, mrctx->backend, mrctx->allocator)
             .ok()) {
-      return Status::OK();
+      return OkStatus();
     }
   }
   return status;
diff --git a/tensorflow/compiler/xrt/xrt_memory_manager.h b/tensorflow/compiler/xrt/xrt_memory_manager.h
index bc154b8..e6fefd7 100644
--- a/tensorflow/compiler/xrt/xrt_memory_manager.h
+++ b/tensorflow/compiler/xrt/xrt_memory_manager.h
@@ -85,7 +85,7 @@
 
   Status Lookup(int64_t handle, RefPtr<XRTTupleAllocation>* tuple) {
     TF_ASSIGN_OR_RETURN(*tuple, Lookup(handle));
-    return Status::OK();
+    return OkStatus();
   }
 
   // Releases an handle by dropping the references count held on the
diff --git a/tensorflow/compiler/xrt/xrt_metrics.cc b/tensorflow/compiler/xrt/xrt_metrics.cc
index 9490653..f310810 100644
--- a/tensorflow/compiler/xrt/xrt_metrics.cc
+++ b/tensorflow/compiler/xrt/xrt_metrics.cc
@@ -82,7 +82,7 @@
       metrics->set_int64_value(point->int64_value);
     }
   }
-  return Status::OK();
+  return OkStatus();
 }
 
 }  // namespace
diff --git a/tensorflow/compiler/xrt/xrt_state.cc b/tensorflow/compiler/xrt/xrt_state.cc
index 56a431f..f4fe56d 100644
--- a/tensorflow/compiler/xrt/xrt_state.cc
+++ b/tensorflow/compiler/xrt/xrt_state.cc
@@ -112,7 +112,7 @@
   TF_RETURN_IF_ERROR(
       transfer_manager->WriteTupleIndexTables(stream.get(), *(buffer->get())));
 
-  return Status::OK();
+  return OkStatus();
 }
 
 }  // namespace
@@ -191,7 +191,7 @@
   (*allocation)
       ->InitializeFromShapedBuffer(shaped_buffer, allocator, device_ordinal);
   (*allocation)->SetDeviceMemorySize();
-  return Status::OK();
+  return OkStatus();
 }
 
 /*static*/ Status XRTTupleAllocation::CreateUninitialized(
@@ -214,7 +214,7 @@
   (*allocation)
       ->InitializeFromShapedBuffer(shaped_buffer, allocator, device_ordinal);
   (*allocation)->SetDeviceMemorySize();
-  return Status::OK();
+  return OkStatus();
 }
 
 /*static*/ Status XRTTupleAllocation::CreateFromBuffer(
@@ -227,7 +227,7 @@
   (*allocation)
       ->InitializeFromShapedBuffer(shaped_buffer, allocator, device_ordinal);
   (*allocation)->SetDeviceMemorySize();
-  return Status::OK();
+  return OkStatus();
 }
 
 /*static*/ Status XRTTupleAllocation::CreateFromBuffer(
@@ -398,7 +398,7 @@
             });
   }
   (*allocation)->SetDeviceMemorySize();
-  return Status::OK();
+  return OkStatus();
 }
 
 void XRTTupleAllocation::SetDeviceMemorySize() {
@@ -447,9 +447,9 @@
                 index.ToString());
           }
         }
-        return Status::OK();
+        return OkStatus();
       }));
-  return Status::OK();
+  return OkStatus();
 }
 
 /*static*/ Status XRTTupleAllocation::MakeTuple(
@@ -494,7 +494,7 @@
           // of it.
           new_tuple_buffers->set_buffer(std::move(buffer), index);
         }
-        return Status::OK();
+        return OkStatus();
       }));
   // Transfer from the ScopedShapedBuffer to a ShapedBuffer, which does not own
   // the newly-allocated index tables. Right now there's no owner for the new
@@ -553,7 +553,7 @@
   // Get another reference since allocation_tmp will be Unrefed automatically on
   // exit.
   (*allocation)->Ref();
-  return Status::OK();
+  return OkStatus();
 }
 
 bool XRTTupleAllocation::IsExclusiveOwner() const {
@@ -644,7 +644,7 @@
     }
     dest_buffer->Unref();
   }
-  return Status::OK();
+  return OkStatus();
 }
 
 xla::StatusOr<xla::ExecutionInput> XRTTupleAllocation::ToExecutionInput(
diff --git a/tensorflow/compiler/xrt/xrt_tpu_device.cc b/tensorflow/compiler/xrt/xrt_tpu_device.cc
index 65f68d9..b747c55 100644
--- a/tensorflow/compiler/xrt/xrt_tpu_device.cc
+++ b/tensorflow/compiler/xrt/xrt_tpu_device.cc
@@ -31,14 +31,14 @@
   if (*rm == nullptr) {
     return errors::Internal("No Tpu resource manager.");
   }
-  return Status::OK();
+  return OkStatus();
 }
 
 Status XRTTpuDeviceAccessor::ScopedRef::Acquire(int device_ordinal) {
   TF_ASSIGN_OR_RETURN(node_context_,
                       tpu::TpuNodeContext::Create(device_ordinal));
   ordinal_ = device_ordinal;
-  return Status::OK();
+  return OkStatus();
 }
 
 Status XRTTpuDeviceAccessor::ScopedRef::Acquire(OpKernelContext* ctx) {
diff --git a/tensorflow/compiler/xrt/xrt_util.cc b/tensorflow/compiler/xrt/xrt_util.cc
index fafa415..3d92de6 100644
--- a/tensorflow/compiler/xrt/xrt_util.cc
+++ b/tensorflow/compiler/xrt/xrt_util.cc
@@ -71,7 +71,7 @@
     }
     handles_[index] = handle;
     handles_release_[index] = release;
-    return Status::OK();
+    return OkStatus();
   }
 
   // Adds a to-be-released tuple allocation at the given index.
@@ -87,7 +87,7 @@
       TF_RETURN_IF_ERROR(memory_manager_->Release(handles_[index]));
     }
     Release(index);
-    return Status::OK();
+    return OkStatus();
   }
 
   // Releases the handle at the given index. The destructor will not use that
@@ -144,7 +144,7 @@
                                           /*alias_parent_allocation=*/true));
     result->reset(tuple);
   }
-  return Status::OK();
+  return OkStatus();
 }
 
 Status PopulateOpWorkingSet(xla::Backend* backend,
@@ -162,7 +162,7 @@
     TF_RETURN_IF_ERROR(working_set->LookupAndPin(
         backend, outputs[input.op_index()], allocator));
   }
-  return Status::OK();
+  return OkStatus();
 }
 
 }  // namespace
@@ -247,7 +247,7 @@
         }
       }
     }
-    return Status::OK();
+    return OkStatus();
   };
   return xla::ShapeUtil::ForEachSubshapeWithStatus(parameter_shape,
                                                    shape_checker)
@@ -371,7 +371,7 @@
     output_tensor->scalar<int64_t>()() =
         memory_manager->Register(std::move(output_tuple));
   }
-  return Status::OK();
+  return OkStatus();
 }
 
 Status ExecuteChained(OpKernelContext* context,
@@ -436,7 +436,7 @@
   for (size_t i = 0; i < results.size(); ++i) {
     output_tensor->vec<int64_t>()(i) = results.Release(i);
   }
-  return Status::OK();
+  return OkStatus();
 }
 
 }  // namespace tensorflow