From be1c54731768a82f5884fe6f6c8b2bea0c61f475 Mon Sep 17 00:00:00 2001 From: Michael Reneer Date: Thu, 2 May 2024 12:03:04 -0700 Subject: [PATCH] Fix import-related lint errors. PiperOrigin-RevId: 630137431 --- .../cc/core/impl/aggregation/tensorflow/BUILD | 12 ++++++------ .../impl/aggregation/tensorflow/checkpoint_reader.cc | 5 ++--- .../impl/aggregation/tensorflow/checkpoint_reader.h | 1 - .../aggregation/tensorflow/checkpoint_reader_test.cc | 4 +--- .../aggregation/tensorflow/checkpoint_writer_test.cc | 2 -- .../cc/core/impl/aggregation/tensorflow/converters.h | 1 - .../impl/aggregation/tensorflow/converters_test.cc | 4 ++-- .../cc/core/impl/aggregation/tensorflow/python/BUILD | 2 ++ .../tensorflow/python/aggregation_protocols.cc | 4 ++++ .../tensorflow_checkpoint_builder_factory.cc | 5 ++--- .../tensorflow_checkpoint_builder_factory_test.cc | 4 ++-- .../tensorflow_checkpoint_parser_factory.cc | 6 ++---- .../tensorflow_checkpoint_parser_factory_test.cc | 2 -- .../cc/core/impl/aggregation/testing/BUILD | 1 + .../cc/core/impl/aggregation/testing/testing.h | 3 +++ 15 files changed, 27 insertions(+), 29 deletions(-) diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/BUILD b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/BUILD index de9f81f7e4..974070561f 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/BUILD +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/BUILD @@ -50,6 +50,7 @@ cc_test( "//tensorflow_federated/cc/core/impl/aggregation/testing:test_data", "//tensorflow_federated/cc/core/impl/executors:status_matchers", "@com_google_absl//absl/status:statusor", + "@com_google_absl//absl/strings:string_view", "@org_tensorflow//tensorflow/core:framework", "@org_tensorflow//tensorflow/core:protos_all_cc", "@org_tensorflow//tensorflow/core/platform:tstring", @@ -65,8 +66,8 @@ cc_library( "//tensorflow_federated/cc/core/impl/aggregation/base", "//tensorflow_federated/cc/core/impl/aggregation/core:tensor", "@com_google_absl//absl/container:flat_hash_map", + "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", - "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@org_tensorflow//tensorflow/c:checkpoint_reader", "@org_tensorflow//tensorflow/c:tf_status_headers", @@ -83,6 +84,7 @@ cc_test( ":checkpoint_reader", "//tensorflow_federated/cc/common_libs:oss_test_main", "//tensorflow_federated/cc/core/impl/aggregation/base", + "//tensorflow_federated/cc/core/impl/aggregation/core:tensor", "//tensorflow_federated/cc/core/impl/aggregation/testing", "//tensorflow_federated/cc/core/impl/executors:status_matchers", "@com_google_absl//absl/strings", @@ -112,7 +114,6 @@ cc_test( "//tensorflow_federated/cc/core/impl/aggregation/core:tensor", "//tensorflow_federated/cc/core/impl/aggregation/testing", "//tensorflow_federated/cc/core/impl/aggregation/testing:test_data", - "//tensorflow_federated/cc/core/impl/executors:status_matchers", ], ) @@ -131,7 +132,7 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:cord", "@org_tensorflow//tensorflow/core/platform:env", - "@org_tensorflow//tensorflow/core/platform:status", + "@org_tensorflow//tensorflow/tsl/platform:env", ], ) @@ -142,9 +143,9 @@ cc_test( ":tensorflow_checkpoint_builder_factory", "//tensorflow_federated/cc/common_libs:oss_test_main", "//tensorflow_federated/cc/core/impl/aggregation/core:tensor", + "//tensorflow_federated/cc/core/impl/aggregation/protocol:checkpoint_builder", "//tensorflow_federated/cc/core/impl/aggregation/testing", "//tensorflow_federated/cc/core/impl/aggregation/testing:test_data", - "//tensorflow_federated/cc/core/impl/executors:status_matchers", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:cord", @@ -162,11 +163,11 @@ cc_library( "//tensorflow_federated/cc/core/impl/aggregation/protocol:checkpoint_parser", "@com_google_absl//absl/cleanup", "@com_google_absl//absl/random", - "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:cord", "@org_tensorflow//tensorflow/core/platform:env", + "@org_tensorflow//tensorflow/tsl/platform:env", ], ) @@ -179,7 +180,6 @@ cc_test( "//tensorflow_federated/cc/core/impl/aggregation/base", "//tensorflow_federated/cc/core/impl/aggregation/protocol:checkpoint_parser", "//tensorflow_federated/cc/core/impl/aggregation/testing", - "//tensorflow_federated/cc/core/impl/executors:status_matchers", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:cord", "@org_tensorflow//tensorflow/cc:cc_ops", diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader.cc b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader.cc index bc43e601bd..fe7c662d24 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader.cc +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader.cc @@ -19,10 +19,10 @@ #include #include #include -#include +#include "absl/status/status.h" +#include "absl/status/statusor.h" #include "absl/strings/str_format.h" -#include "absl/strings/string_view.h" #include "tensorflow/c/checkpoint_reader.h" #include "tensorflow/c/tf_status.h" #include "tensorflow/c/tf_status_helper.h" @@ -30,7 +30,6 @@ #include "tensorflow/core/framework/tensor_shape.h" #include "tensorflow/core/framework/types.pb.h" #include "tensorflow_federated/cc/core/impl/aggregation/base/monitoring.h" -#include "tensorflow_federated/cc/core/impl/aggregation/core/datatype.h" #include "tensorflow_federated/cc/core/impl/aggregation/core/tensor.h" #include "tensorflow_federated/cc/core/impl/aggregation/tensorflow/converters.h" diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader.h b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader.h index 3abf00154f..964c64311a 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader.h +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader.h @@ -23,7 +23,6 @@ #include "absl/container/flat_hash_map.h" #include "absl/status/statusor.h" #include "tensorflow/c/checkpoint_reader.h" -#include "tensorflow_federated/cc/core/impl/aggregation/core/datatype.h" #include "tensorflow_federated/cc/core/impl/aggregation/core/tensor.h" #include "tensorflow_federated/cc/core/impl/aggregation/core/tensor_shape.h" diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader_test.cc b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader_test.cc index 6f7f3a11ac..42f38f6680 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader_test.cc +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader_test.cc @@ -16,10 +16,7 @@ #include "tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader.h" -#include #include -#include -#include #include #include "googlemock/include/gmock/gmock.h" @@ -27,6 +24,7 @@ #include "absl/strings/string_view.h" #include "tensorflow_federated/cc/core/impl/aggregation/base/monitoring.h" #include "tensorflow_federated/cc/core/impl/aggregation/base/platform.h" +#include "tensorflow_federated/cc/core/impl/aggregation/core/datatype.h" #include "tensorflow_federated/cc/core/impl/aggregation/testing/testing.h" #include "tensorflow_federated/cc/core/impl/executors/status_matchers.h" diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_writer_test.cc b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_writer_test.cc index 598a67d258..dc431118fc 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_writer_test.cc +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_writer_test.cc @@ -18,7 +18,6 @@ #include #include -#include #include "googlemock/include/gmock/gmock.h" #include "googletest/include/gtest/gtest.h" @@ -28,7 +27,6 @@ #include "tensorflow_federated/cc/core/impl/aggregation/tensorflow/checkpoint_reader.h" #include "tensorflow_federated/cc/core/impl/aggregation/testing/test_data.h" #include "tensorflow_federated/cc/core/impl/aggregation/testing/testing.h" -#include "tensorflow_federated/cc/core/impl/executors/status_matchers.h" namespace tensorflow_federated::aggregation::tensorflow { namespace { diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/converters.h b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/converters.h index 35ced38736..049015b56a 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/converters.h +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/converters.h @@ -24,7 +24,6 @@ #include "tensorflow/core/framework/types.pb.h" #include "tensorflow/core/protobuf/struct.pb.h" #include "tensorflow_federated/cc/core/impl/aggregation/base/monitoring.h" -#include "tensorflow_federated/cc/core/impl/aggregation/core/datatype.h" #include "tensorflow_federated/cc/core/impl/aggregation/core/tensor.h" #include "tensorflow_federated/cc/core/impl/aggregation/core/tensor_shape.h" #include "tensorflow_federated/cc/core/impl/aggregation/core/tensor_spec.h" diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/converters_test.cc b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/converters_test.cc index 4eba1506af..6eba7b49b4 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/converters_test.cc +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/converters_test.cc @@ -16,14 +16,13 @@ #include "tensorflow_federated/cc/core/impl/aggregation/tensorflow/converters.h" +#include #include #include #include #include #include -#include "tensorflow_federated/cc/core/impl/executors/status_matchers.h" - // clang-format off #include "tensorflow_federated/cc/core/impl/aggregation/testing/parse_text_proto.h" // clang-format on @@ -44,6 +43,7 @@ #include "tensorflow_federated/cc/core/impl/aggregation/core/vector_string_data.h" #include "tensorflow_federated/cc/core/impl/aggregation/testing/test_data.h" #include "tensorflow_federated/cc/core/impl/aggregation/testing/testing.h" +#include "tensorflow_federated/cc/core/impl/executors/status_matchers.h" namespace tensorflow_federated::aggregation::tensorflow { namespace { diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/python/BUILD b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/python/BUILD index 700101a099..d31a532803 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/python/BUILD +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/python/BUILD @@ -30,7 +30,9 @@ pybind_extension( "//tensorflow_federated/cc/core/impl/aggregation/protocol/simple_aggregation", "//tensorflow_federated/cc/core/impl/aggregation/tensorflow:tensorflow_checkpoint_builder_factory", "//tensorflow_federated/cc/core/impl/aggregation/tensorflow:tensorflow_checkpoint_parser_factory", + "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", + "@com_google_absl//absl/strings:cord", "@pybind11_abseil//pybind11_abseil:status_casters", "@pybind11_protobuf//pybind11_protobuf:native_proto_caster", ], diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/python/aggregation_protocols.cc b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/python/aggregation_protocols.cc index 34126b97db..f2e8528a3d 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/python/aggregation_protocols.cc +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/python/aggregation_protocols.cc @@ -16,14 +16,18 @@ #include +#include #include #include +#include "absl/status/status.h" #include "absl/status/statusor.h" +#include "absl/strings/cord.h" #include "pybind11_abseil/status_casters.h" #include "pybind11_protobuf/native_proto_caster.h" #include "tensorflow_federated/cc/core/impl/aggregation/protocol/aggregation_protocol.h" #include "tensorflow_federated/cc/core/impl/aggregation/protocol/configuration.pb.h" +#include "tensorflow_federated/cc/core/impl/aggregation/protocol/resource_resolver.h" #include "tensorflow_federated/cc/core/impl/aggregation/protocol/simple_aggregation/simple_aggregation_protocol.h" #include "tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_builder_factory.h" #include "tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_parser_factory.h" diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_builder_factory.cc b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_builder_factory.cc index 725f4a36de..3903a74d36 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_builder_factory.cc +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_builder_factory.cc @@ -28,9 +28,8 @@ #include "absl/strings/cord.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "tensorflow/core/platform/env.h" #include "tensorflow/core/platform/file_system.h" -#include "tensorflow/core/platform/status.h" +#include "tensorflow/tsl/platform/env.h" #include "tensorflow_federated/cc/core/impl/aggregation/base/monitoring.h" #include "tensorflow_federated/cc/core/impl/aggregation/core/tensor.h" #include "tensorflow_federated/cc/core/impl/aggregation/protocol/checkpoint_builder.h" @@ -39,7 +38,7 @@ namespace tensorflow_federated::aggregation::tensorflow { namespace { -using ::tensorflow::Env; +using tsl::Env; // A CheckpointBuilder implementation that builds TensorFlow checkpoints using a // CheckpointWriter. diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_builder_factory_test.cc b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_builder_factory_test.cc index ec87d08c5d..6d1cffc879 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_builder_factory_test.cc +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_builder_factory_test.cc @@ -16,8 +16,8 @@ #include "tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_builder_factory.h" +#include #include -#include #include "googlemock/include/gmock/gmock.h" #include "googletest/include/gtest/gtest.h" @@ -27,9 +27,9 @@ #include "tensorflow_federated/cc/core/impl/aggregation/core/mutable_vector_data.h" #include "tensorflow_federated/cc/core/impl/aggregation/core/tensor.h" #include "tensorflow_federated/cc/core/impl/aggregation/core/tensor_shape.h" +#include "tensorflow_federated/cc/core/impl/aggregation/protocol/checkpoint_builder.h" #include "tensorflow_federated/cc/core/impl/aggregation/testing/test_data.h" #include "tensorflow_federated/cc/core/impl/aggregation/testing/testing.h" -#include "tensorflow_federated/cc/core/impl/executors/status_matchers.h" namespace tensorflow_federated::aggregation::tensorflow { namespace { diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_parser_factory.cc b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_parser_factory.cc index cf2a1cc39c..dd21957730 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_parser_factory.cc +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_parser_factory.cc @@ -16,8 +16,7 @@ #include "tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_parser_factory.h" -#include - +#include #include #include #include @@ -25,13 +24,12 @@ #include "absl/cleanup/cleanup.h" #include "absl/random/random.h" -#include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/cord.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "tensorflow/core/platform/env.h" #include "tensorflow/core/platform/file_system.h" +#include "tensorflow/tsl/platform/env.h" #include "tensorflow_federated/cc/core/impl/aggregation/base/monitoring.h" #include "tensorflow_federated/cc/core/impl/aggregation/core/tensor.h" #include "tensorflow_federated/cc/core/impl/aggregation/protocol/checkpoint_parser.h" diff --git a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_parser_factory_test.cc b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_parser_factory_test.cc index 81214bcad3..df34546cab 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_parser_factory_test.cc +++ b/tensorflow_federated/cc/core/impl/aggregation/tensorflow/tensorflow_checkpoint_parser_factory_test.cc @@ -18,7 +18,6 @@ #include #include -#include #include "googlemock/include/gmock/gmock.h" #include "googletest/include/gtest/gtest.h" @@ -27,7 +26,6 @@ #include "tensorflow_federated/cc/core/impl/aggregation/base/platform.h" #include "tensorflow_federated/cc/core/impl/aggregation/protocol/checkpoint_parser.h" #include "tensorflow_federated/cc/core/impl/aggregation/testing/testing.h" -#include "tensorflow_federated/cc/core/impl/executors/status_matchers.h" namespace tensorflow_federated::aggregation::tensorflow { namespace { diff --git a/tensorflow_federated/cc/core/impl/aggregation/testing/BUILD b/tensorflow_federated/cc/core/impl/aggregation/testing/BUILD index d769fb4aca..4523305dff 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/testing/BUILD +++ b/tensorflow_federated/cc/core/impl/aggregation/testing/BUILD @@ -27,6 +27,7 @@ cc_library( "//tensorflow_federated/cc/core/impl/aggregation/base", "//tensorflow_federated/cc/core/impl/aggregation/core:intrinsic", "//tensorflow_federated/cc/core/impl/aggregation/core:tensor", + "//tensorflow_federated/cc/core/impl/executors:status_matchers", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/memory", "@com_google_absl//absl/status", diff --git a/tensorflow_federated/cc/core/impl/aggregation/testing/testing.h b/tensorflow_federated/cc/core/impl/aggregation/testing/testing.h index ff26f8b3f3..57b65d2e0a 100644 --- a/tensorflow_federated/cc/core/impl/aggregation/testing/testing.h +++ b/tensorflow_federated/cc/core/impl/aggregation/testing/testing.h @@ -42,6 +42,9 @@ #include "tensorflow_federated/cc/core/impl/aggregation/core/intrinsic.h" #include "tensorflow_federated/cc/core/impl/aggregation/core/tensor.h" #include "tensorflow_federated/cc/core/impl/aggregation/core/tensor_shape.h" +// clang-format off +#include "tensorflow_federated/cc/core/impl/executors/status_matchers.h" +// clang-format on namespace tensorflow_federated::aggregation {