From 958710325182ff9d89e842ff29f1cc5dc6da08bb Mon Sep 17 00:00:00 2001 From: Scott Zhu Date: Wed, 28 Oct 2020 10:37:05 -0700 Subject: [PATCH] Update keras benchmark test to use public TF API. PiperOrigin-RevId: 339489416 Change-Id: If526ae1f84e3516c85c683a823ad85d7e36baeb8 --- .../preprocessing/benchmarks/category_crossing_benchmark.py | 2 +- .../preprocessing/benchmarks/category_encoding_benchmark.py | 2 +- .../preprocessing/benchmarks/discretization_adapt_benchmark.py | 2 +- .../keras/layers/preprocessing/benchmarks/hashing_benchmark.py | 2 +- .../layers/preprocessing/benchmarks/image_preproc_benchmark.py | 2 +- .../preprocessing/benchmarks/index_lookup_adapt_benchmark.py | 2 +- .../preprocessing/benchmarks/normalization_adapt_benchmark.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tensorflow/python/keras/layers/preprocessing/benchmarks/category_crossing_benchmark.py b/tensorflow/python/keras/layers/preprocessing/benchmarks/category_crossing_benchmark.py index efc0ca3766f..b7ace2b9a07 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/category_crossing_benchmark.py +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/category_crossing_benchmark.py @@ -45,7 +45,7 @@ def int_gen(): yield (np.random.randint(0, 5, (1,)), np.random.randint(0, 7, (1,))) -class BenchmarkLayer(benchmark.Benchmark): +class BenchmarkLayer(benchmark.TensorFlowBenchmark): """Benchmark the layer forward pass.""" def run_dataset_implementation(self, batch_size): diff --git a/tensorflow/python/keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py b/tensorflow/python/keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py index 71b4c7b6b61..08b0233e2d9 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py @@ -36,7 +36,7 @@ FLAGS = flags.FLAGS v2_compat.enable_v2_behavior() -class BenchmarkLayer(benchmark.Benchmark): +class BenchmarkLayer(benchmark.TensorFlowBenchmark): """Benchmark the layer forward pass.""" def run_dataset_implementation(self, output_mode, batch_size, sequence_length, diff --git a/tensorflow/python/keras/layers/preprocessing/benchmarks/discretization_adapt_benchmark.py b/tensorflow/python/keras/layers/preprocessing/benchmarks/discretization_adapt_benchmark.py index d0fb194791a..bb0d59e743a 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/discretization_adapt_benchmark.py +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/discretization_adapt_benchmark.py @@ -48,7 +48,7 @@ def reduce_fn(state, values, epsilon=EPSILON): return (discretization.merge_summaries(state_, summary, epsilon),) -class BenchmarkAdapt(benchmark.Benchmark): +class BenchmarkAdapt(benchmark.TensorFlowBenchmark): """Benchmark adapt.""" def run_dataset_implementation(self, num_elements, batch_size): diff --git a/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py b/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py index 68ab28c7f6c..ffce276ec86 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py @@ -47,7 +47,7 @@ def word_gen(): yield "".join(random.choice(string.ascii_letters) for i in range(2)) -class BenchmarkLayer(benchmark.Benchmark): +class BenchmarkLayer(benchmark.TensorFlowBenchmark): """Benchmark the layer forward pass.""" def run_dataset_implementation(self, batch_size): diff --git a/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py b/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py index 302c890c823..6ef4e7a7291 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py @@ -85,7 +85,7 @@ def image_augmentation(inputs, batch_size): return img -class BenchmarkLayer(benchmark.Benchmark): +class BenchmarkLayer(benchmark.TensorFlowBenchmark): """Benchmark the layer forward pass.""" def run_dataset_implementation(self, batch_size): diff --git a/tensorflow/python/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py b/tensorflow/python/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py index 621a4588715..a43d57c91ae 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/index_lookup_adapt_benchmark.py @@ -63,7 +63,7 @@ def get_top_k(dataset, k): return sorted_vocab -class BenchmarkAdapt(benchmark.Benchmark): +class BenchmarkAdapt(benchmark.TensorFlowBenchmark): """Benchmark adapt.""" def run_numpy_implementation(self, num_elements, batch_size, k): diff --git a/tensorflow/python/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py b/tensorflow/python/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py index dfce2963f75..ae8ac3f0023 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py @@ -60,7 +60,7 @@ def reduce_fn(state, values): return (k, n + batch_size, ex, ex2) -class BenchmarkAdapt(benchmark.Benchmark): +class BenchmarkAdapt(benchmark.TensorFlowBenchmark): """Benchmark adapt.""" def run_dataset_implementation(self, num_elements, batch_size):