Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 626268001
  • Loading branch information
tensorflower-gardener committed Apr 19, 2024
1 parent aa58642 commit 0fe2bcd
Show file tree
Hide file tree
Showing 19 changed files with 160 additions and 159 deletions.
2 changes: 1 addition & 1 deletion tensorflow/core/framework/resource_op_kernel.h
Expand Up @@ -141,7 +141,7 @@ class ResourceOpKernel : public OpKernel {
// it is compatible with this op's configuration. The verification may fail in
// cases such as two graphs asking queues of the same shared name to have
// inconsistent capacities.
virtual Status VerifyResource(T* resource) { return OkStatus(); }
virtual Status VerifyResource(T* resource) { return absl::OkStatus(); }

Tensor tensor_ TF_GUARDED_BY(mu_);

Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/framework/resource_op_kernel_test.cc
Expand Up @@ -69,7 +69,7 @@ class StubResourceOpKernel : public ResourceOpKernel<StubResource> {
return errors::InvalidArgument("stub has code ", resource->code,
" but requested code ", code);
}
return OkStatus();
return absl::OkStatus();
}
};

Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/framework/resource_var.cc
Expand Up @@ -37,7 +37,7 @@ Status Var::AsGraphDef(GraphDefBuilder* builder, Node** out) const {
builder->opts().WithAttr("dtype", tensor_.dtype()));
*out =
ops::UnaryOp("Identity", var, builder->opts().WithControlInput(assign));
return OkStatus();
return absl::OkStatus();
}

std::string Var::MakeRefCountingHandleName(int64_t resource_id) const {
Expand Down
12 changes: 6 additions & 6 deletions tensorflow/core/framework/run_handler.cc
Expand Up @@ -622,24 +622,24 @@ void RunHandlerThreadPool::WorkerLoop(int thread_id,
}
}
if (t.f) {
profiler::TraceMe activity(
tsl::profiler::TraceMe activity(
[=] {
return strings::StrCat(task_from_blocking_queue ? "inter" : "intra",
" #id = ", tws->GetTracemeId(), " ",
thread_id, "#");
},
profiler::TraceMeLevel::kInfo);
tsl::profiler::TraceMeLevel::kInfo);
VLOG(2) << "Running " << (task_from_blocking_queue ? "inter" : "intra")
<< " work from " << tws->GetTracemeId();
tws->IncrementInflightTaskCount(task_from_blocking_queue);
env_.ExecuteTask(t);
tws->DecrementInflightTaskCount(task_from_blocking_queue);
} else {
profiler::TraceMe activity(
tsl::profiler::TraceMe activity(
[=] {
return strings::StrCat("Sleeping#thread_id=", thread_id, "#");
},
profiler::TraceMeLevel::kInfo);
tsl::profiler::TraceMeLevel::kInfo);
if (VLOG_IS_ON(4)) {
for (int i = 0; i < thread_work_sources->size(); ++i) {
VLOG(4) << "source id " << i << " "
Expand Down Expand Up @@ -847,12 +847,12 @@ class RunHandlerPool::Impl {
{
mutex_lock l(mu_);
if (!has_free_handler()) {
profiler::TraceMe activity(
tsl::profiler::TraceMe activity(
[&] {
return strings::StrCat("WaitingForHandler#step_id=", step_id,
"#");
},
profiler::TraceMeLevel::kInfo);
tsl::profiler::TraceMeLevel::kInfo);
TRACESTRING(
strings::StrCat("RunHandlerPool::Impl::Get waiting for a handler "
"with timeout in millisecond",
Expand Down
16 changes: 8 additions & 8 deletions tensorflow/core/framework/run_handler_test.cc
Expand Up @@ -650,7 +650,7 @@ TEST_F(RunHandlerTest, UseRunHandlerPoolEnableSubPool) {
Initialize({3, 2, -1, 0});
auto session = CreateSession();
ASSERT_TRUE(session != nullptr);
EXPECT_EQ(OkStatus(), session->Create(def_));
EXPECT_EQ(absl::OkStatus(), session->Create(def_));
std::vector<std::pair<string, Tensor>> inputs;

// Request two targets: one fetch output and one non-fetched output.
Expand All @@ -664,7 +664,7 @@ TEST_F(RunHandlerTest, UseRunHandlerPoolEnableSubPool) {

Status s = session->Run(run_options, inputs, output_names, target_nodes,
&outputs, nullptr);
EXPECT_EQ(OkStatus(), s);
EXPECT_EQ(absl::OkStatus(), s);

ASSERT_EQ(1, outputs.size());
// The first output should be initialized and have the correct
Expand All @@ -678,7 +678,7 @@ TEST_F(RunHandlerTest, TestConcurrencyUseRunHandlerPool) {
Initialize({1, 2, 3, 4});
auto session = CreateSession();
ASSERT_TRUE(session != nullptr);
EXPECT_EQ(OkStatus(), session->Create(def_));
EXPECT_EQ(absl::OkStatus(), session->Create(def_));

RunOptions run_options;
run_options.mutable_experimental()->set_use_run_handler_pool(true);
Expand All @@ -695,7 +695,7 @@ TEST_F(RunHandlerTest, TestConcurrencyUseRunHandlerPool) {
// Run the graph
Status s = session->Run(run_options, inputs, output_names, {}, &outputs,
nullptr);
EXPECT_EQ(OkStatus(), s);
EXPECT_EQ(absl::OkStatus(), s);
ASSERT_EQ(1, outputs.size());
auto mat = outputs[0].matrix<float>();
EXPECT_FLOAT_EQ(3.0, mat(0, 0));
Expand All @@ -714,7 +714,7 @@ TEST_F(RunHandlerTest, UseRunHandlerPoolEnableSubPoolWithPriority) {
Initialize({3, 2, -1, 0});
auto session = CreateSession();
ASSERT_TRUE(session != nullptr);
EXPECT_EQ(OkStatus(), session->Create(def_));
EXPECT_EQ(absl::OkStatus(), session->Create(def_));
std::vector<std::pair<string, Tensor>> inputs;

// Request two targets: one fetch output and one non-fetched output.
Expand All @@ -731,7 +731,7 @@ TEST_F(RunHandlerTest, UseRunHandlerPoolEnableSubPoolWithPriority) {

Status s = session->Run(run_options, inputs, output_names, target_nodes,
&outputs, nullptr);
EXPECT_EQ(OkStatus(), s);
EXPECT_EQ(absl::OkStatus(), s);

ASSERT_EQ(1, outputs.size());
// The first output should be initialized and have the correct
Expand All @@ -745,7 +745,7 @@ TEST_F(RunHandlerTest, TestConcurrencyUseRunHandlerPoolWithPriority) {
Initialize({1, 2, 3, 4});
auto session = CreateSession();
ASSERT_TRUE(session != nullptr);
EXPECT_EQ(OkStatus(), session->Create(def_));
EXPECT_EQ(absl::OkStatus(), session->Create(def_));

// Fill in the input and ask for the output
thread::ThreadPool* tp = new thread::ThreadPool(Env::Default(), "test", 4);
Expand All @@ -764,7 +764,7 @@ TEST_F(RunHandlerTest, TestConcurrencyUseRunHandlerPoolWithPriority) {
// Run the graph
Status s = session->Run(run_options, inputs, output_names, {}, &outputs,
nullptr);
EXPECT_EQ(OkStatus(), s);
EXPECT_EQ(absl::OkStatus(), s);
ASSERT_EQ(1, outputs.size());
auto mat = outputs[0].matrix<float>();
EXPECT_FLOAT_EQ(3.0, mat(0, 0));
Expand Down

0 comments on commit 0fe2bcd

Please sign in to comment.