From f65f285b443acbcb926106054c9a85aa374ec7ad Mon Sep 17 00:00:00 2001 From: Scott Zhu Date: Tue, 3 Nov 2020 21:30:37 -0800 Subject: [PATCH] Update KPL benchmark for redundant absl flag import. Also update the build deps to populate explicit dependency. PiperOrigin-RevId: 340581042 Change-Id: I684b24d752c33bccc677da6b2534a4bc9ccfe1e0 --- .../keras/layers/preprocessing/benchmarks/BUILD | 15 ++++++++------- .../benchmarks/category_crossing_benchmark.py | 3 --- .../benchmarks/category_encoding_benchmark.py | 3 --- .../benchmarks/discretization_adapt_benchmark.py | 2 -- .../preprocessing/benchmarks/hashing_benchmark.py | 3 --- .../benchmarks/image_preproc_benchmark.py | 3 --- .../benchmarks/index_lookup_adapt_benchmark.py | 3 --- .../benchmarks/normalization_adapt_benchmark.py | 3 --- 8 files changed, 8 insertions(+), 27 deletions(-) diff --git a/tensorflow/python/keras/layers/preprocessing/benchmarks/BUILD b/tensorflow/python/keras/layers/preprocessing/benchmarks/BUILD index 7a965bfe2c2..f46c06dd366 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/BUILD +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/BUILD @@ -27,7 +27,6 @@ tf_py_test( "//tensorflow/python/compat:v2_compat", "//tensorflow/python/data/ops:dataset_ops", "//tensorflow/python/keras/layers/preprocessing:category_encoding", - "@absl_py//absl/flags", ], ) @@ -45,7 +44,6 @@ tf_py_test( "//tensorflow/python/compat:v2_compat", "//tensorflow/python/data/ops:dataset_ops", "//tensorflow/python/keras/layers/preprocessing:category_crossing", - "@absl_py//absl/flags", ], ) @@ -63,7 +61,6 @@ tf_py_test( "//tensorflow/python/compat:v2_compat", "//tensorflow/python/data/ops:dataset_ops", "//tensorflow/python/keras/layers/preprocessing:hashing", - "@absl_py//absl/flags", ], ) @@ -80,7 +77,6 @@ tf_py_test( "//tensorflow/python/compat:v2_compat", "//tensorflow/python/data/ops:dataset_ops", "//tensorflow/python/keras/layers/preprocessing:index_lookup", - "@absl_py//absl/flags", ], ) @@ -99,7 +95,6 @@ tf_py_test( "//tensorflow/python/compat:v2_compat", "//tensorflow/python/data/ops:dataset_ops", "//tensorflow/python/keras/layers/preprocessing:normalization", - "@absl_py//absl/flags", ], ) @@ -108,7 +103,14 @@ tf_py_test( srcs = ["discretization_adapt_benchmark.py"], python_version = "PY3", deps = [ - "//tensorflow:tensorflow_py", + "//tensorflow/python:array_ops", + "//tensorflow/python:client_testlib", + "//tensorflow/python:dtypes", + "//tensorflow/python:extra_py_tests_deps", + "//tensorflow/python:math_ops", + "//tensorflow/python:platform_benchmark", + "//tensorflow/python/compat:v2_compat", + "//tensorflow/python/data/ops:dataset_ops", "//tensorflow/python/keras/layers/preprocessing:discretization", ], ) @@ -129,6 +131,5 @@ cuda_py_test( "//tensorflow/python/compat:v2_compat", "//tensorflow/python/data/ops:dataset_ops", "//tensorflow/python/keras/layers/preprocessing:image_preprocessing", - "@absl_py//absl/flags", ], ) 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 b7ace2b9a07..5a4fc71de7b 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/category_crossing_benchmark.py +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/category_crossing_benchmark.py @@ -20,7 +20,6 @@ from __future__ import print_function import itertools import time -from absl import flags import numpy as np from tensorflow.python import keras @@ -33,8 +32,6 @@ from tensorflow.python.ops import sparse_ops from tensorflow.python.platform import benchmark from tensorflow.python.platform import test -FLAGS = flags.FLAGS - v2_compat.enable_v2_behavior() 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 08b0233e2d9..bc751ae362e 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/category_encoding_benchmark.py @@ -19,7 +19,6 @@ from __future__ import print_function import time -from absl import flags import numpy as np from tensorflow.python import keras @@ -31,8 +30,6 @@ from tensorflow.python.ops import random_ops from tensorflow.python.platform import benchmark from tensorflow.python.platform import test -FLAGS = flags.FLAGS - v2_compat.enable_v2_behavior() 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 bb0d59e743a..59777f36b11 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/discretization_adapt_benchmark.py +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/discretization_adapt_benchmark.py @@ -19,7 +19,6 @@ from __future__ import print_function import time -from absl import flags import numpy as np from tensorflow.python import keras @@ -32,7 +31,6 @@ from tensorflow.python.ops import math_ops from tensorflow.python.platform import benchmark from tensorflow.python.platform import test -FLAGS = flags.FLAGS EPSILON = 0.1 v2_compat.enable_v2_behavior() diff --git a/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py b/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py index ffce276ec86..0af47fd7ba5 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/hashing_benchmark.py @@ -22,7 +22,6 @@ import random import string import time -from absl import flags import numpy as np from tensorflow.python import keras @@ -35,8 +34,6 @@ from tensorflow.python.ops import string_ops from tensorflow.python.platform import benchmark from tensorflow.python.platform import test -FLAGS = flags.FLAGS - v2_compat.enable_v2_behavior() 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 6ef4e7a7291..1fa66c694e9 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/image_preproc_benchmark.py @@ -20,7 +20,6 @@ from __future__ import print_function import functools import time -from absl import flags import numpy as np from tensorflow.python import keras @@ -36,8 +35,6 @@ from tensorflow.python.ops import random_ops from tensorflow.python.platform import benchmark from tensorflow.python.platform import test -FLAGS = flags.FLAGS - v2_compat.enable_v2_behavior() LOWER = .2 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 a43d57c91ae..a373166ba6b 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 @@ -23,7 +23,6 @@ import random import string import time -from absl import flags import numpy as np from tensorflow.python import keras @@ -35,8 +34,6 @@ from tensorflow.python.keras.layers.preprocessing import index_lookup from tensorflow.python.platform import benchmark from tensorflow.python.platform import test -FLAGS = flags.FLAGS - v2_compat.enable_v2_behavior() 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 ae8ac3f0023..9f8386fde91 100644 --- a/tensorflow/python/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py +++ b/tensorflow/python/keras/layers/preprocessing/benchmarks/normalization_adapt_benchmark.py @@ -19,7 +19,6 @@ from __future__ import print_function import time -from absl import flags import numpy as np from tensorflow.python import keras @@ -33,8 +32,6 @@ from tensorflow.python.ops import math_ops from tensorflow.python.platform import benchmark from tensorflow.python.platform import test -FLAGS = flags.FLAGS - v2_compat.enable_v2_behavior()