Skip to content

Commit

Permalink
Format and fix a few files.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 557359718
  • Loading branch information
shan3290 authored and tensorflower-gardener committed Aug 16, 2023
1 parent 5a596bc commit 11278e4
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 9 deletions.
5 changes: 3 additions & 2 deletions tensorflow/core/common_runtime/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2118,8 +2118,10 @@ cc_library(
hdrs = ["request_cost.h"],
visibility = ["//visibility:public"],
deps = [
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
],
)
Expand Down Expand Up @@ -3193,9 +3195,8 @@ tf_cc_test(
srcs = ["request_cost_test.cc"],
deps = [
":request_cost",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest_main",
],
)

Expand Down
3 changes: 3 additions & 0 deletions tensorflow/core/common_runtime/request_cost.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ limitations under the License.

#include "tensorflow/core/common_runtime/request_cost.h"

#include <string>
#include <utility>
#include <vector>

#include "absl/container/flat_hash_map.h"
#include "absl/strings/string_view.h"
#include "absl/synchronization/mutex.h"
#include "absl/time/time.h"

namespace tensorflow {
Expand Down
2 changes: 2 additions & 0 deletions tensorflow/core/common_runtime/request_cost.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ limitations under the License.
#include <utility>
#include <vector>

#include "absl/base/thread_annotations.h"
#include "absl/container/flat_hash_map.h"
#include "absl/strings/string_view.h"
#include "absl/synchronization/mutex.h"
#include "absl/time/time.h"

namespace tensorflow {
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/core/common_runtime/request_cost_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ limitations under the License.

#include "tensorflow/core/common_runtime/request_cost.h"

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "absl/time/time.h"
#include "tensorflow/core/platform/test.h"

namespace tensorflow {
namespace {
Expand Down
8 changes: 6 additions & 2 deletions tensorflow/core/kernels/batching_util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,16 @@ tf_cc_test(
srcs = ["batch_resource_base_test.cc"],
deps = [
":batch_resource_base",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:framework",
"//tensorflow/core/common_runtime:cost_measurement",
"//tensorflow/core/common_runtime:cost_measurement_registry",
"//tensorflow/core/common_runtime:no_op_cost_measurement",
"//tensorflow/core/common_runtime:request_cost",
"//tensorflow/core/framework:types_proto_cc",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest_main",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
#include "tensorflow/core/kernels/batching_util/batch_resource_base.h"

#include <algorithm>
#include <cstdint>
#include <functional>
#include <iterator>
#include <memory>
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/core/kernels/batching_util/batch_resource_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
#ifndef TENSORFLOW_CORE_KERNELS_BATCHING_UTIL_BATCH_RESOURCE_BASE_H_
#define TENSORFLOW_CORE_KERNELS_BATCHING_UTIL_BATCH_RESOURCE_BASE_H_

#include <cstdint>
#include <functional>
#include <map>
#include <memory>
Expand Down Expand Up @@ -233,7 +234,7 @@ class BatchResourceBase : public ResourceBase {
// padding's size. Here padding's cost is not assigned to any tasks.
static void SplitBatchCosts(
std::vector<std::unique_ptr<CostMeasurement>>& batch_cost_measurements,
const int64_t processed_size, BatchT& batch);
int64_t processed_size, BatchT& batch);

private:
// Implementation of calling the process batch function.
Expand Down
16 changes: 13 additions & 3 deletions tensorflow/core/kernels/batching_util/batch_resource_base_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@ limitations under the License.

#include "tensorflow/core/kernels/batching_util/batch_resource_base.h"

#include <cstdint>
#include <memory>
#include <vector>

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "absl/memory/memory.h"
#include "absl/strings/string_view.h"
#include "absl/time/time.h"
#include "tensorflow/core/common_runtime/cost_measurement.h"
#include "tensorflow/core/common_runtime/cost_measurement_registry.h"
#include "tensorflow/core/common_runtime/no_op_cost_measurement.h"
#include "tensorflow/core/platform/test.h"
#include "tensorflow/core/common_runtime/request_cost.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor_shape.h"
#include "tensorflow/core/framework/types.pb.h"

namespace tensorflow {
namespace serving {
Expand Down Expand Up @@ -48,7 +58,7 @@ REGISTER_COST_MEASUREMENT("test_gcu", TestGcuCostMeasurement);

std::unique_ptr<BatchResourceBase::BatchTask> MakeBatchTask(
const int64_t task_size, RequestCost* request_cost) {
auto task = absl::make_unique<BatchResourceBase::BatchTask>();
auto task = std::make_unique<BatchResourceBase::BatchTask>();
task->inputs.push_back(Tensor(DT_DOUBLE, TensorShape({task_size, 1})));
task->request_cost = request_cost;
return task;
Expand Down

0 comments on commit 11278e4

Please sign in to comment.