Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 626912026
  • Loading branch information
tensorflower-gardener committed Apr 22, 2024
1 parent caed155 commit 0122aff
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 25 deletions.
12 changes: 7 additions & 5 deletions tensorflow/core/tfrt/fallback/fallback_state.cc
Expand Up @@ -56,7 +56,7 @@ DeviceAttributes BuildDeviceAttributes(absl::string_view name_prefix,

} // namespace

StatusOr<std::unique_ptr<FallbackState>> FallbackState::Create(
absl::StatusOr<std::unique_ptr<FallbackState>> FallbackState::Create(
const SessionOptions &session_options,
const tensorflow::FunctionDefLibrary &fdef_lib) {
// Create devices.
Expand All @@ -68,7 +68,8 @@ StatusOr<std::unique_ptr<FallbackState>> FallbackState::Create(
fdef_lib);
}

StatusOr<std::unique_ptr<FallbackState>> FallbackState::CreateWithCpuDevice(
absl::StatusOr<std::unique_ptr<FallbackState>>
FallbackState::CreateWithCpuDevice(
const SessionOptions &session_options,
const tensorflow::FunctionDefLibrary &fdef_lib) {
// Create devices.
Expand All @@ -80,7 +81,8 @@ StatusOr<std::unique_ptr<FallbackState>> FallbackState::CreateWithCpuDevice(
fdef_lib);
}

StatusOr<std::unique_ptr<FallbackState>> FallbackState::CreateWithMockGpuDevice(
absl::StatusOr<std::unique_ptr<FallbackState>>
FallbackState::CreateWithMockGpuDevice(
const SessionOptions &session_options,
const tensorflow::FunctionDefLibrary &fdef_lib) {
// Create devices.
Expand Down Expand Up @@ -112,7 +114,7 @@ FallbackState::FallbackState(const SessionOptions &session_options,
tsl::core::RefCountPtr<Rendezvous> *r) {
*r = tsl::core::RefCountPtr<Rendezvous>(
new IntraProcessRendezvous(device_mgr));
return OkStatus();
return absl::OkStatus();
}}) {
for (auto *d : device_manager_.ListDevices()) {
device_set_.AddDevice(d);
Expand All @@ -122,7 +124,7 @@ FallbackState::FallbackState(const SessionOptions &session_options,
device_set_.set_client_device(device_manager_.HostCPU());
}

StatusOr<std::unique_ptr<GraphExecutionState>>
absl::StatusOr<std::unique_ptr<GraphExecutionState>>
FallbackState::CreateGraphExecutionState(GraphDef graph_def,
bool run_placer) const {
// Create GraphExecutionState which contains the preprocessed graph including
Expand Down
10 changes: 5 additions & 5 deletions tensorflow/core/tfrt/fallback/fallback_state.h
Expand Up @@ -35,15 +35,15 @@ class FallbackState {
public:
// The FunctionDefLibrary is passed in to initialize the
// ProcessFunctionLibraryRuntime member of this class
static StatusOr<std::unique_ptr<FallbackState>> Create(
static absl::StatusOr<std::unique_ptr<FallbackState>> Create(
const SessionOptions &session_options,
const tensorflow::FunctionDefLibrary &fdef_lib);

static StatusOr<std::unique_ptr<FallbackState>> CreateWithCpuDevice(
static absl::StatusOr<std::unique_ptr<FallbackState>> CreateWithCpuDevice(
const SessionOptions &session_options,
const tensorflow::FunctionDefLibrary &fdef_lib);

static StatusOr<std::unique_ptr<FallbackState>> CreateWithMockGpuDevice(
static absl::StatusOr<std::unique_ptr<FallbackState>> CreateWithMockGpuDevice(
const SessionOptions &session_options,
const tensorflow::FunctionDefLibrary &fdef_lib);

Expand All @@ -53,8 +53,8 @@ class FallbackState {

// Create GraphExecutionState from the `graph_def`. The result will contain a
// preprocessed graph with runtime information such as devices.
StatusOr<std::unique_ptr<GraphExecutionState>> CreateGraphExecutionState(
GraphDef graph_def, bool run_placer = true) const;
absl::StatusOr<std::unique_ptr<GraphExecutionState>>
CreateGraphExecutionState(GraphDef graph_def, bool run_placer = true) const;

// Adds `func_def` to the function library.
Status AddFunctionDef(const FunctionDef &func_def);
Expand Down
12 changes: 6 additions & 6 deletions tensorflow/core/tfrt/fallback/op_kernel_runner.cc
Expand Up @@ -31,19 +31,19 @@ Status CheckOpDefCompatibility(const tensorflow::OpDef& op_def) {
return tensorflow::errors::Internal(
"TFRT kernel fallback error: Unsupported ref args in ",
op_def.name());
return OkStatus();
return absl::OkStatus();
};

for (const auto& arg_def : op_def.input_arg())
TF_RETURN_IF_ERROR(check_arg_def(arg_def));
for (const auto& arg_def : op_def.output_arg())
TF_RETURN_IF_ERROR(check_arg_def(arg_def));

return OkStatus();
return absl::OkStatus();
}

// Create a tensorflow::NodeDef from the tensorflow::OpDef and the attributes.
StatusOr<tensorflow::NodeDef> BuildNodeDef(
absl::StatusOr<tensorflow::NodeDef> BuildNodeDef(
const tensorflow::OpDef& op_def, absl::string_view node_name, int num_args,
const std::function<Status(tensorflow::AttrValueMap*)>& attr_builder) {
tensorflow::NodeDef node_def;
Expand Down Expand Up @@ -78,12 +78,12 @@ tensorflow::Status CreateOpKernel(
tensorflow::OpKernel* k = nullptr;
TF_RETURN_IF_ERROR(flr->CreateKernel(props, &k));
result->reset(k);
return OkStatus();
return absl::OkStatus();
}

} // namespace

StatusOr<OpKernelRunner> OpKernelRunner::Create(
absl::StatusOr<OpKernelRunner> OpKernelRunner::Create(
absl::string_view op_name, absl::string_view node_name,
absl::string_view device_name, int num_args,
const std::function<Status(tensorflow::AttrValueMap*)>& attr_builder,
Expand All @@ -106,7 +106,7 @@ StatusOr<OpKernelRunner> OpKernelRunner::Create(
process_function_library_runtime, device);
}

StatusOr<OpKernelRunner> OpKernelRunner::Create(
absl::StatusOr<OpKernelRunner> OpKernelRunner::Create(
absl::string_view op_name, absl::string_view node_name, int num_args,
const std::function<Status(tensorflow::AttrValueMap*)>& attr_builder,
const tensorflow::ProcessFunctionLibraryRuntime&
Expand Down
14 changes: 7 additions & 7 deletions tensorflow/core/tfrt/fallback/op_kernel_runner.h
Expand Up @@ -41,7 +41,7 @@ namespace tfrt_stub {

class OpKernelRunner {
public:
static StatusOr<OpKernelRunner> Create(
static absl::StatusOr<OpKernelRunner> Create(
absl::string_view op_name, absl::string_view node_name,
absl::string_view device_name, int num_args,
const std::function<Status(tensorflow::AttrValueMap*)>& attr_builder,
Expand All @@ -50,7 +50,7 @@ class OpKernelRunner {
process_function_library_runtime);

ABSL_DEPRECATED("Please use the Create() method that takes node_name.")
static StatusOr<OpKernelRunner> Create(
static absl::StatusOr<OpKernelRunner> Create(
absl::string_view op_name, absl::string_view device_name, int num_args,
const std::function<Status(tensorflow::AttrValueMap*)>& attr_builder,
const tensorflow::DeviceMgr& device_manager,
Expand All @@ -61,15 +61,15 @@ class OpKernelRunner {
process_function_library_runtime);
}

static StatusOr<OpKernelRunner> Create(
static absl::StatusOr<OpKernelRunner> Create(
absl::string_view op_name, absl::string_view node_name, int num_args,
const std::function<Status(tensorflow::AttrValueMap*)>& attr_builder,
const tensorflow::ProcessFunctionLibraryRuntime&
process_function_library_runtime,
tensorflow::Device* device);

ABSL_DEPRECATED("Please use the Create() method that takes node_name.")
static StatusOr<OpKernelRunner> Create(
static absl::StatusOr<OpKernelRunner> Create(
absl::string_view op_name, int num_args,
const std::function<Status(tensorflow::AttrValueMap*)>& attr_builder,
const tensorflow::ProcessFunctionLibraryRuntime&
Expand Down Expand Up @@ -130,8 +130,8 @@ class OpKernelRunner {
tensorflow::FunctionLibraryRuntime* function_library_runtime = nullptr;
tensorflow::ResourceMgr* resource_manager = nullptr;
bool is_async = false;
gtl::InlinedVector<AllocatorAttributes, 4> input_alloc_attrs;
gtl::InlinedVector<AllocatorAttributes, 1> output_alloc_attrs;
absl::InlinedVector<AllocatorAttributes, 4UL> input_alloc_attrs;
absl::InlinedVector<AllocatorAttributes, 1UL> output_alloc_attrs;
};
std::unique_ptr<Info> info_;
};
Expand All @@ -141,7 +141,7 @@ struct OpKernelRunState {
std::vector<const tensorflow::TensorBuffer*> tensor_buffers;
std::vector<tensorflow::TensorValue> input_tf_tensor_values;
OpKernelContext::Params params;
gtl::InlinedVector<tensorflow::Tensor, 4> input_tf_tensors;
absl::InlinedVector<tensorflow::Tensor, 4UL> input_tf_tensors;

OpKernelRunState() = default;
OpKernelRunState(absl::Span<const tensorflow::TensorValue> tensor_values,
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/tfrt/fallback/op_kernel_runner_cache.cc
Expand Up @@ -24,7 +24,7 @@ limitations under the License.
namespace tensorflow {
namespace tfrt_stub {

StatusOr<OpKernelRunner*> OpKernelRunnerCache::GetOrCreate(
absl::StatusOr<OpKernelRunner*> OpKernelRunnerCache::GetOrCreate(
tfrt::Location loc, absl::string_view op_name,
absl::string_view device_name, int num_args,
const std::function<Status(tensorflow::AttrValueMap*)>& attr_builder,
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/tfrt/fallback/op_kernel_runner_cache.h
Expand Up @@ -51,7 +51,7 @@ class OpKernelRunnerCache {
public:
OpKernelRunnerCache() = default;

StatusOr<OpKernelRunner*> GetOrCreate(
absl::StatusOr<OpKernelRunner*> GetOrCreate(
tfrt::Location loc, absl::string_view op_name,
absl::string_view device_name, int num_args,
const std::function<Status(tensorflow::AttrValueMap*)>& attr_builder,
Expand Down

0 comments on commit 0122aff

Please sign in to comment.