From 2fb71ff8cf98c9d848f5140b9f6a07a4a7ab3e5d Mon Sep 17 00:00:00 2001 From: Nupur Garg Date: Tue, 3 Mar 2020 08:53:46 -0800 Subject: [PATCH] Make generate_examples run in 2.0. PiperOrigin-RevId: 298616596 Change-Id: Ib0be0a8929e75634924c28165f6fcd998b77add9 --- tensorflow/lite/build_def.bzl | 10 +++- tensorflow/lite/testing/generate_examples.py | 4 +- .../lite/testing/generate_examples_lib.py | 2 +- tensorflow/lite/testing/op_tests/abs.py | 2 +- tensorflow/lite/testing/op_tests/add_n.py | 2 +- .../lite/testing/op_tests/arg_min_max.py | 3 +- .../testing/op_tests/batch_to_space_nd.py | 2 +- tensorflow/lite/testing/op_tests/binary_op.py | 2 +- tensorflow/lite/testing/op_tests/cast.py | 2 +- tensorflow/lite/testing/op_tests/ceil.py | 2 +- tensorflow/lite/testing/op_tests/concat.py | 2 +- tensorflow/lite/testing/op_tests/constant.py | 2 +- .../lite/testing/op_tests/control_dep.py | 2 +- tensorflow/lite/testing/op_tests/conv.py | 2 +- .../lite/testing/op_tests/conv2d_transpose.py | 2 +- .../lite/testing/op_tests/conv_activation.py | 2 +- ...nv_to_depthwiseconv_with_shared_weights.py | 2 +- .../op_tests/conv_with_shared_weights.py | 2 +- tensorflow/lite/testing/op_tests/cos.py | 2 +- .../lite/testing/op_tests/depth_to_space.py | 2 +- .../lite/testing/op_tests/depthwiseconv.py | 2 +- .../lite/testing/op_tests/elementwise.py | 2 +- tensorflow/lite/testing/op_tests/elu.py | 2 +- .../lite/testing/op_tests/embedding_lookup.py | 2 +- tensorflow/lite/testing/op_tests/equal.py | 2 +- tensorflow/lite/testing/op_tests/exp.py | 2 +- .../lite/testing/op_tests/expand_dims.py | 2 +- tensorflow/lite/testing/op_tests/eye.py | 2 +- tensorflow/lite/testing/op_tests/fill.py | 2 +- tensorflow/lite/testing/op_tests/floor.py | 2 +- .../lite/testing/op_tests/fully_connected.py | 2 +- .../lite/testing/op_tests/fused_batch_norm.py | 2 +- tensorflow/lite/testing/op_tests/gather.py | 2 +- tensorflow/lite/testing/op_tests/gather_nd.py | 2 +- .../testing/op_tests/gather_with_constant.py | 2 +- .../testing/op_tests/global_batch_norm.py | 2 +- tensorflow/lite/testing/op_tests/greater.py | 2 +- .../lite/testing/op_tests/greater_equal.py | 2 +- tensorflow/lite/testing/op_tests/hardswish.py | 2 +- tensorflow/lite/testing/op_tests/identity.py | 2 +- tensorflow/lite/testing/op_tests/l2norm.py | 2 +- .../testing/op_tests/l2norm_shared_epsilon.py | 2 +- .../lite/testing/op_tests/leaky_relu.py | 2 +- tensorflow/lite/testing/op_tests/less.py | 2 +- .../lite/testing/op_tests/less_equal.py | 2 +- .../testing/op_tests/local_response_norm.py | 2 +- .../lite/testing/op_tests/log_softmax.py | 2 +- tensorflow/lite/testing/op_tests/logic.py | 2 +- tensorflow/lite/testing/op_tests/lstm.py | 2 +- .../lite/testing/op_tests/matrix_diag.py | 2 +- .../lite/testing/op_tests/matrix_set_diag.py | 2 +- tensorflow/lite/testing/op_tests/maximum.py | 2 +- tensorflow/lite/testing/op_tests/minimum.py | 2 +- .../lite/testing/op_tests/mirror_pad.py | 2 +- .../lite/testing/op_tests/nearest_upsample.py | 2 +- tensorflow/lite/testing/op_tests/neg.py | 2 +- tensorflow/lite/testing/op_tests/not_equal.py | 2 +- tensorflow/lite/testing/op_tests/one_hot.py | 2 +- tensorflow/lite/testing/op_tests/pack.py | 2 +- tensorflow/lite/testing/op_tests/pad.py | 2 +- tensorflow/lite/testing/op_tests/padv2.py | 2 +- .../op_tests/placeholder_with_default.py | 2 +- tensorflow/lite/testing/op_tests/pool.py | 2 +- tensorflow/lite/testing/op_tests/prelu.py | 2 +- tensorflow/lite/testing/op_tests/range.py | 2 +- tensorflow/lite/testing/op_tests/rank.py | 2 +- tensorflow/lite/testing/op_tests/reduce.py | 2 +- tensorflow/lite/testing/op_tests/relu.py | 2 +- tensorflow/lite/testing/op_tests/relu1.py | 2 +- tensorflow/lite/testing/op_tests/relu6.py | 2 +- tensorflow/lite/testing/op_tests/reshape.py | 2 +- .../lite/testing/op_tests/resize_bilinear.py | 2 +- .../op_tests/resize_nearest_neighbor.py | 2 +- .../resolve_constant_strided_slice.py | 2 +- .../lite/testing/op_tests/reverse_sequence.py | 2 +- .../lite/testing/op_tests/reverse_v2.py | 2 +- tensorflow/lite/testing/op_tests/rfft2d.py | 2 +- tensorflow/lite/testing/op_tests/round.py | 2 +- tensorflow/lite/testing/op_tests/shape.py | 2 +- tensorflow/lite/testing/op_tests/sigmoid.py | 2 +- tensorflow/lite/testing/op_tests/slice.py | 2 +- tensorflow/lite/testing/op_tests/softmax.py | 2 +- .../testing/op_tests/space_to_batch_nd.py | 2 +- .../lite/testing/op_tests/space_to_depth.py | 2 +- .../lite/testing/op_tests/sparse_to_dense.py | 2 +- tensorflow/lite/testing/op_tests/split.py | 2 +- tensorflow/lite/testing/op_tests/splitv.py | 2 +- tensorflow/lite/testing/op_tests/squeeze.py | 2 +- .../testing/op_tests/squeeze_transpose.py | 2 +- .../lite/testing/op_tests/strided_slice.py | 2 +- .../op_tests/strided_slice_np_style.py | 2 +- tensorflow/lite/testing/op_tests/tanh.py | 2 +- tensorflow/lite/testing/op_tests/tile.py | 2 +- tensorflow/lite/testing/op_tests/topk.py | 2 +- tensorflow/lite/testing/op_tests/transpose.py | 2 +- .../lite/testing/op_tests/transpose_conv.py | 2 +- .../lite/testing/op_tests/unfused_gru.py | 2 +- .../op_tests/unidirectional_sequence_lstm.py | 2 +- .../op_tests/unidirectional_sequence_rnn.py | 2 +- tensorflow/lite/testing/op_tests/unique.py | 2 +- tensorflow/lite/testing/op_tests/unpack.py | 2 +- .../testing/op_tests/unroll_batch_matmul.py | 2 +- tensorflow/lite/testing/op_tests/where.py | 2 +- .../lite/testing/op_tests/zeros_like.py | 2 +- tensorflow/lite/testing/toco_convert.py | 2 +- tensorflow/lite/testing/zip_test_utils.py | 58 +++++++++---------- 106 files changed, 141 insertions(+), 138 deletions(-) diff --git a/tensorflow/lite/build_def.bzl b/tensorflow/lite/build_def.bzl index b8aefa3e645..9b78aa4df1f 100644 --- a/tensorflow/lite/build_def.bzl +++ b/tensorflow/lite/build_def.bzl @@ -255,7 +255,7 @@ def generated_test_models(): "ceil", "concat", "constant", - "control_dep", + # "control_dep", # b/150647401 "conv", "conv_relu", "conv_relu1", @@ -388,8 +388,12 @@ def generated_test_models_failing(conversion_mode): "unidirectional_sequence_rnn", ] elif conversion_mode == "forward-compat": - return [] - return [] + return [ + "merged_models", # b/150647401 + ] + return [ + "merged_models", # b/150647401 + ] def generated_test_models_successful(conversion_mode): """Returns the list of successful test models. diff --git a/tensorflow/lite/testing/generate_examples.py b/tensorflow/lite/testing/generate_examples.py index fd21d42d2d5..bc87fde9467 100644 --- a/tensorflow/lite/testing/generate_examples.py +++ b/tensorflow/lite/testing/generate_examples.py @@ -29,7 +29,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf import argparse import os import sys @@ -132,4 +132,4 @@ if __name__ == "__main__": print("\nGot the following unparsed args, %r please fix.\n" % unparsed) exit(1) else: - tf.compat.v1.app.run(main=main, argv=[sys.argv[0]] + unparsed) + tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) diff --git a/tensorflow/lite/testing/generate_examples_lib.py b/tensorflow/lite/testing/generate_examples_lib.py index c974070b8f9..9b3b7866caa 100644 --- a/tensorflow/lite/testing/generate_examples_lib.py +++ b/tensorflow/lite/testing/generate_examples_lib.py @@ -35,7 +35,7 @@ import os import re import zipfile -import tensorflow as tf +import tensorflow.compat.v1 as tf # TODO(aselle): Disable GPU for now os.environ["CUDA_VISIBLE_DEVICES"] = "-1" diff --git a/tensorflow/lite/testing/op_tests/abs.py b/tensorflow/lite/testing/op_tests/abs.py index 9757fd5d115..581831db120 100644 --- a/tensorflow/lite/testing/op_tests/abs.py +++ b/tensorflow/lite/testing/op_tests/abs.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/add_n.py b/tensorflow/lite/testing/op_tests/add_n.py index 51ae351464e..2385bd89600 100644 --- a/tensorflow/lite/testing/op_tests/add_n.py +++ b/tensorflow/lite/testing/op_tests/add_n.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/arg_min_max.py b/tensorflow/lite/testing/op_tests/arg_min_max.py index 88ddafb8fbe..e693ce6f44a 100644 --- a/tensorflow/lite/testing/op_tests/arg_min_max.py +++ b/tensorflow/lite/testing/op_tests/arg_min_max.py @@ -19,8 +19,7 @@ from __future__ import print_function import random -import tensorflow as tf - +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/batch_to_space_nd.py b/tensorflow/lite/testing/op_tests/batch_to_space_nd.py index 3284cf9571d..861ebbb9529 100644 --- a/tensorflow/lite/testing/op_tests/batch_to_space_nd.py +++ b/tensorflow/lite/testing/op_tests/batch_to_space_nd.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/binary_op.py b/tensorflow/lite/testing/op_tests/binary_op.py index 88702b0542f..48c4296cc19 100644 --- a/tensorflow/lite/testing/op_tests/binary_op.py +++ b/tensorflow/lite/testing/op_tests/binary_op.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/cast.py b/tensorflow/lite/testing/op_tests/cast.py index ffa59e02044..a65b6e43a89 100644 --- a/tensorflow/lite/testing/op_tests/cast.py +++ b/tensorflow/lite/testing/op_tests/cast.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/ceil.py b/tensorflow/lite/testing/op_tests/ceil.py index c648bb206e4..8f7324d2741 100644 --- a/tensorflow/lite/testing/op_tests/ceil.py +++ b/tensorflow/lite/testing/op_tests/ceil.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/concat.py b/tensorflow/lite/testing/op_tests/concat.py index 2c15318deda..1cb726ceb1d 100644 --- a/tensorflow/lite/testing/op_tests/concat.py +++ b/tensorflow/lite/testing/op_tests/concat.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/constant.py b/tensorflow/lite/testing/op_tests/constant.py index 03c31dc7094..312f911887a 100644 --- a/tensorflow/lite/testing/op_tests/constant.py +++ b/tensorflow/lite/testing/op_tests/constant.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/control_dep.py b/tensorflow/lite/testing/op_tests/control_dep.py index f6467e54dd6..bd9e369303b 100644 --- a/tensorflow/lite/testing/op_tests/control_dep.py +++ b/tensorflow/lite/testing/op_tests/control_dep.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import ExtraTocoOptions from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests diff --git a/tensorflow/lite/testing/op_tests/conv.py b/tensorflow/lite/testing/op_tests/conv.py index c23f571251d..3a12cafe478 100644 --- a/tensorflow/lite/testing/op_tests/conv.py +++ b/tensorflow/lite/testing/op_tests/conv.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/conv2d_transpose.py b/tensorflow/lite/testing/op_tests/conv2d_transpose.py index 2f3f7430b4a..ec0b793292f 100644 --- a/tensorflow/lite/testing/op_tests/conv2d_transpose.py +++ b/tensorflow/lite/testing/op_tests/conv2d_transpose.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/conv_activation.py b/tensorflow/lite/testing/op_tests/conv_activation.py index 4ee2ae80af7..b4cc4c6ba58 100644 --- a/tensorflow/lite/testing/op_tests/conv_activation.py +++ b/tensorflow/lite/testing/op_tests/conv_activation.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/conv_to_depthwiseconv_with_shared_weights.py b/tensorflow/lite/testing/op_tests/conv_to_depthwiseconv_with_shared_weights.py index fa0d188bc8b..1185e971bfe 100644 --- a/tensorflow/lite/testing/op_tests/conv_to_depthwiseconv_with_shared_weights.py +++ b/tensorflow/lite/testing/op_tests/conv_to_depthwiseconv_with_shared_weights.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/conv_with_shared_weights.py b/tensorflow/lite/testing/op_tests/conv_with_shared_weights.py index e3228cb5830..6f4499af9d4 100644 --- a/tensorflow/lite/testing/op_tests/conv_with_shared_weights.py +++ b/tensorflow/lite/testing/op_tests/conv_with_shared_weights.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/cos.py b/tensorflow/lite/testing/op_tests/cos.py index 20b831dce9a..13ce39f1508 100644 --- a/tensorflow/lite/testing/op_tests/cos.py +++ b/tensorflow/lite/testing/op_tests/cos.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/depth_to_space.py b/tensorflow/lite/testing/op_tests/depth_to_space.py index 13859017a59..9693a664c54 100644 --- a/tensorflow/lite/testing/op_tests/depth_to_space.py +++ b/tensorflow/lite/testing/op_tests/depth_to_space.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/depthwiseconv.py b/tensorflow/lite/testing/op_tests/depthwiseconv.py index 4741469388f..1e20244e8f7 100644 --- a/tensorflow/lite/testing/op_tests/depthwiseconv.py +++ b/tensorflow/lite/testing/op_tests/depthwiseconv.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/elementwise.py b/tensorflow/lite/testing/op_tests/elementwise.py index 12b6dd196e9..0cb607d783b 100644 --- a/tensorflow/lite/testing/op_tests/elementwise.py +++ b/tensorflow/lite/testing/op_tests/elementwise.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/elu.py b/tensorflow/lite/testing/op_tests/elu.py index 9d23a823a56..12fbe981165 100644 --- a/tensorflow/lite/testing/op_tests/elu.py +++ b/tensorflow/lite/testing/op_tests/elu.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/embedding_lookup.py b/tensorflow/lite/testing/op_tests/embedding_lookup.py index eed7edd4564..cdcbb7143d4 100644 --- a/tensorflow/lite/testing/op_tests/embedding_lookup.py +++ b/tensorflow/lite/testing/op_tests/embedding_lookup.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/equal.py b/tensorflow/lite/testing/op_tests/equal.py index 68b2b5f1e3b..76a3fed1456 100644 --- a/tensorflow/lite/testing/op_tests/equal.py +++ b/tensorflow/lite/testing/op_tests/equal.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/exp.py b/tensorflow/lite/testing/op_tests/exp.py index c9018c0d17c..4d0e9256169 100644 --- a/tensorflow/lite/testing/op_tests/exp.py +++ b/tensorflow/lite/testing/op_tests/exp.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/expand_dims.py b/tensorflow/lite/testing/op_tests/expand_dims.py index 45ad9c6f97c..a7a21b8694a 100644 --- a/tensorflow/lite/testing/op_tests/expand_dims.py +++ b/tensorflow/lite/testing/op_tests/expand_dims.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/eye.py b/tensorflow/lite/testing/op_tests/eye.py index 111c7bd6598..cd6b6a00938 100644 --- a/tensorflow/lite/testing/op_tests/eye.py +++ b/tensorflow/lite/testing/op_tests/eye.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_scalar_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/fill.py b/tensorflow/lite/testing/op_tests/fill.py index 21a9a29e091..541651a5445 100644 --- a/tensorflow/lite/testing/op_tests/fill.py +++ b/tensorflow/lite/testing/op_tests/fill.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_scalar_data from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests diff --git a/tensorflow/lite/testing/op_tests/floor.py b/tensorflow/lite/testing/op_tests/floor.py index 731bfa3c091..b9da4afb006 100644 --- a/tensorflow/lite/testing/op_tests/floor.py +++ b/tensorflow/lite/testing/op_tests/floor.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/fully_connected.py b/tensorflow/lite/testing/op_tests/fully_connected.py index c5a7dc81fea..0cc0dfbedbe 100644 --- a/tensorflow/lite/testing/op_tests/fully_connected.py +++ b/tensorflow/lite/testing/op_tests/fully_connected.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/fused_batch_norm.py b/tensorflow/lite/testing/op_tests/fused_batch_norm.py index 10ed48ed013..f0d7b4fa98b 100644 --- a/tensorflow/lite/testing/op_tests/fused_batch_norm.py +++ b/tensorflow/lite/testing/op_tests/fused_batch_norm.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/gather.py b/tensorflow/lite/testing/op_tests/gather.py index a5340ceb8a9..fa9ed7814c3 100644 --- a/tensorflow/lite/testing/op_tests/gather.py +++ b/tensorflow/lite/testing/op_tests/gather.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/gather_nd.py b/tensorflow/lite/testing/op_tests/gather_nd.py index 5f17ea968ef..1137488469e 100644 --- a/tensorflow/lite/testing/op_tests/gather_nd.py +++ b/tensorflow/lite/testing/op_tests/gather_nd.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/gather_with_constant.py b/tensorflow/lite/testing/op_tests/gather_with_constant.py index f529003cb47..2a9e93bff07 100644 --- a/tensorflow/lite/testing/op_tests/gather_with_constant.py +++ b/tensorflow/lite/testing/op_tests/gather_with_constant.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/global_batch_norm.py b/tensorflow/lite/testing/op_tests/global_batch_norm.py index 903a3f55e23..9e3270b3ffa 100644 --- a/tensorflow/lite/testing/op_tests/global_batch_norm.py +++ b/tensorflow/lite/testing/op_tests/global_batch_norm.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/greater.py b/tensorflow/lite/testing/op_tests/greater.py index b543930bc52..f30a085020b 100644 --- a/tensorflow/lite/testing/op_tests/greater.py +++ b/tensorflow/lite/testing/op_tests/greater.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/greater_equal.py b/tensorflow/lite/testing/op_tests/greater_equal.py index c67b3494c67..20a49719f12 100644 --- a/tensorflow/lite/testing/op_tests/greater_equal.py +++ b/tensorflow/lite/testing/op_tests/greater_equal.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/hardswish.py b/tensorflow/lite/testing/op_tests/hardswish.py index 6f7c9262e71..b645a4f3c29 100644 --- a/tensorflow/lite/testing/op_tests/hardswish.py +++ b/tensorflow/lite/testing/op_tests/hardswish.py @@ -20,7 +20,7 @@ from __future__ import print_function import functools import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/identity.py b/tensorflow/lite/testing/op_tests/identity.py index 712ef994fbf..45aa8af7699 100644 --- a/tensorflow/lite/testing/op_tests/identity.py +++ b/tensorflow/lite/testing/op_tests/identity.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/l2norm.py b/tensorflow/lite/testing/op_tests/l2norm.py index a5a78779679..932b0cfc908 100644 --- a/tensorflow/lite/testing/op_tests/l2norm.py +++ b/tensorflow/lite/testing/op_tests/l2norm.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/l2norm_shared_epsilon.py b/tensorflow/lite/testing/op_tests/l2norm_shared_epsilon.py index 8cadb19276c..0971422eaa5 100644 --- a/tensorflow/lite/testing/op_tests/l2norm_shared_epsilon.py +++ b/tensorflow/lite/testing/op_tests/l2norm_shared_epsilon.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/leaky_relu.py b/tensorflow/lite/testing/op_tests/leaky_relu.py index e437cfd7d73..e37df7722f5 100644 --- a/tensorflow/lite/testing/op_tests/leaky_relu.py +++ b/tensorflow/lite/testing/op_tests/leaky_relu.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/less.py b/tensorflow/lite/testing/op_tests/less.py index 44b32f98b43..099f0039454 100644 --- a/tensorflow/lite/testing/op_tests/less.py +++ b/tensorflow/lite/testing/op_tests/less.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/less_equal.py b/tensorflow/lite/testing/op_tests/less_equal.py index 2a96d65f10e..2e8e8d03887 100644 --- a/tensorflow/lite/testing/op_tests/less_equal.py +++ b/tensorflow/lite/testing/op_tests/less_equal.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/local_response_norm.py b/tensorflow/lite/testing/op_tests/local_response_norm.py index a5390d18d02..dea49775b8c 100644 --- a/tensorflow/lite/testing/op_tests/local_response_norm.py +++ b/tensorflow/lite/testing/op_tests/local_response_norm.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/log_softmax.py b/tensorflow/lite/testing/op_tests/log_softmax.py index 210b947eb75..0543158de0c 100644 --- a/tensorflow/lite/testing/op_tests/log_softmax.py +++ b/tensorflow/lite/testing/op_tests/log_softmax.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/logic.py b/tensorflow/lite/testing/op_tests/logic.py index d2e2045d3a3..743d6ecab90 100644 --- a/tensorflow/lite/testing/op_tests/logic.py +++ b/tensorflow/lite/testing/op_tests/logic.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/lstm.py b/tensorflow/lite/testing/op_tests/lstm.py index 65c35e4ffe3..549c839873e 100644 --- a/tensorflow/lite/testing/op_tests/lstm.py +++ b/tensorflow/lite/testing/op_tests/lstm.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import ExtraTocoOptions from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests diff --git a/tensorflow/lite/testing/op_tests/matrix_diag.py b/tensorflow/lite/testing/op_tests/matrix_diag.py index 4382c03bc25..835e07f3777 100644 --- a/tensorflow/lite/testing/op_tests/matrix_diag.py +++ b/tensorflow/lite/testing/op_tests/matrix_diag.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/matrix_set_diag.py b/tensorflow/lite/testing/op_tests/matrix_set_diag.py index 9ce3adf708f..41cd6ba7c09 100644 --- a/tensorflow/lite/testing/op_tests/matrix_set_diag.py +++ b/tensorflow/lite/testing/op_tests/matrix_set_diag.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/maximum.py b/tensorflow/lite/testing/op_tests/maximum.py index ebdd60c66ab..a78ac6eb8c7 100644 --- a/tensorflow/lite/testing/op_tests/maximum.py +++ b/tensorflow/lite/testing/op_tests/maximum.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/minimum.py b/tensorflow/lite/testing/op_tests/minimum.py index ec973779de3..1591acc291f 100644 --- a/tensorflow/lite/testing/op_tests/minimum.py +++ b/tensorflow/lite/testing/op_tests/minimum.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/mirror_pad.py b/tensorflow/lite/testing/op_tests/mirror_pad.py index c002e44d214..0d466354ac3 100644 --- a/tensorflow/lite/testing/op_tests/mirror_pad.py +++ b/tensorflow/lite/testing/op_tests/mirror_pad.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/nearest_upsample.py b/tensorflow/lite/testing/op_tests/nearest_upsample.py index eb0ca6ea437..9a437ee0ae1 100644 --- a/tensorflow/lite/testing/op_tests/nearest_upsample.py +++ b/tensorflow/lite/testing/op_tests/nearest_upsample.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/neg.py b/tensorflow/lite/testing/op_tests/neg.py index c85a5cde5db..25fdf39e808 100644 --- a/tensorflow/lite/testing/op_tests/neg.py +++ b/tensorflow/lite/testing/op_tests/neg.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/not_equal.py b/tensorflow/lite/testing/op_tests/not_equal.py index 08c40bd13d3..7ecf6e2ffb6 100644 --- a/tensorflow/lite/testing/op_tests/not_equal.py +++ b/tensorflow/lite/testing/op_tests/not_equal.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/one_hot.py b/tensorflow/lite/testing/op_tests/one_hot.py index ef92e11f5f3..44385d9ff97 100644 --- a/tensorflow/lite/testing/op_tests/one_hot.py +++ b/tensorflow/lite/testing/op_tests/one_hot.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/pack.py b/tensorflow/lite/testing/op_tests/pack.py index 149c2be2f09..1db34685f3b 100644 --- a/tensorflow/lite/testing/op_tests/pack.py +++ b/tensorflow/lite/testing/op_tests/pack.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/pad.py b/tensorflow/lite/testing/op_tests/pad.py index a136fee547b..0746a5a1601 100644 --- a/tensorflow/lite/testing/op_tests/pad.py +++ b/tensorflow/lite/testing/op_tests/pad.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/padv2.py b/tensorflow/lite/testing/op_tests/padv2.py index 0a121d409e6..d34a682f88b 100644 --- a/tensorflow/lite/testing/op_tests/padv2.py +++ b/tensorflow/lite/testing/op_tests/padv2.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/placeholder_with_default.py b/tensorflow/lite/testing/op_tests/placeholder_with_default.py index c6dcd6af38a..d081f0f983e 100644 --- a/tensorflow/lite/testing/op_tests/placeholder_with_default.py +++ b/tensorflow/lite/testing/op_tests/placeholder_with_default.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function from tensorflow.lite.testing.zip_test_utils import TF_TYPE_INFO diff --git a/tensorflow/lite/testing/op_tests/pool.py b/tensorflow/lite/testing/op_tests/pool.py index f334d2a77ab..a2063c6dcee 100644 --- a/tensorflow/lite/testing/op_tests/pool.py +++ b/tensorflow/lite/testing/op_tests/pool.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/prelu.py b/tensorflow/lite/testing/op_tests/prelu.py index 3fb593598ce..f927c7a8b00 100644 --- a/tensorflow/lite/testing/op_tests/prelu.py +++ b/tensorflow/lite/testing/op_tests/prelu.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/range.py b/tensorflow/lite/testing/op_tests/range.py index 63ba7bce4e6..ad3d2dfc252 100644 --- a/tensorflow/lite/testing/op_tests/range.py +++ b/tensorflow/lite/testing/op_tests/range.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_scalar_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/rank.py b/tensorflow/lite/testing/op_tests/rank.py index f27afdab853..277b967cb1b 100644 --- a/tensorflow/lite/testing/op_tests/rank.py +++ b/tensorflow/lite/testing/op_tests/rank.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/reduce.py b/tensorflow/lite/testing/op_tests/reduce.py index 1437bdffbfe..f6d05cbbdfc 100644 --- a/tensorflow/lite/testing/op_tests/reduce.py +++ b/tensorflow/lite/testing/op_tests/reduce.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/relu.py b/tensorflow/lite/testing/op_tests/relu.py index ee021b3e591..943a996cd0b 100644 --- a/tensorflow/lite/testing/op_tests/relu.py +++ b/tensorflow/lite/testing/op_tests/relu.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/relu1.py b/tensorflow/lite/testing/op_tests/relu1.py index ac92bac1cb2..7a061bca66d 100644 --- a/tensorflow/lite/testing/op_tests/relu1.py +++ b/tensorflow/lite/testing/op_tests/relu1.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/relu6.py b/tensorflow/lite/testing/op_tests/relu6.py index db75c22895c..16ff4b9eebc 100644 --- a/tensorflow/lite/testing/op_tests/relu6.py +++ b/tensorflow/lite/testing/op_tests/relu6.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/reshape.py b/tensorflow/lite/testing/op_tests/reshape.py index 752c1fa53c1..26bc0f7db35 100644 --- a/tensorflow/lite/testing/op_tests/reshape.py +++ b/tensorflow/lite/testing/op_tests/reshape.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/resize_bilinear.py b/tensorflow/lite/testing/op_tests/resize_bilinear.py index 897d3ceb5f6..0316e84b692 100644 --- a/tensorflow/lite/testing/op_tests/resize_bilinear.py +++ b/tensorflow/lite/testing/op_tests/resize_bilinear.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/resize_nearest_neighbor.py b/tensorflow/lite/testing/op_tests/resize_nearest_neighbor.py index 24b8b2aebe4..4e49e0bb39b 100644 --- a/tensorflow/lite/testing/op_tests/resize_nearest_neighbor.py +++ b/tensorflow/lite/testing/op_tests/resize_nearest_neighbor.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/resolve_constant_strided_slice.py b/tensorflow/lite/testing/op_tests/resolve_constant_strided_slice.py index f4409db789e..c0ef994a7b1 100644 --- a/tensorflow/lite/testing/op_tests/resolve_constant_strided_slice.py +++ b/tensorflow/lite/testing/op_tests/resolve_constant_strided_slice.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/reverse_sequence.py b/tensorflow/lite/testing/op_tests/reverse_sequence.py index a42cbfd8d86..3b2a56d484c 100644 --- a/tensorflow/lite/testing/op_tests/reverse_sequence.py +++ b/tensorflow/lite/testing/op_tests/reverse_sequence.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/reverse_v2.py b/tensorflow/lite/testing/op_tests/reverse_v2.py index 05a0b169abe..97e833781dc 100644 --- a/tensorflow/lite/testing/op_tests/reverse_v2.py +++ b/tensorflow/lite/testing/op_tests/reverse_v2.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/rfft2d.py b/tensorflow/lite/testing/op_tests/rfft2d.py index 9eb607fd136..1e4ea42d879 100644 --- a/tensorflow/lite/testing/op_tests/rfft2d.py +++ b/tensorflow/lite/testing/op_tests/rfft2d.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import ExtraTocoOptions from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests diff --git a/tensorflow/lite/testing/op_tests/round.py b/tensorflow/lite/testing/op_tests/round.py index a4b62e1ae51..42a7a148b62 100644 --- a/tensorflow/lite/testing/op_tests/round.py +++ b/tensorflow/lite/testing/op_tests/round.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/shape.py b/tensorflow/lite/testing/op_tests/shape.py index 9ae78d3cdb2..b7c5a767eed 100644 --- a/tensorflow/lite/testing/op_tests/shape.py +++ b/tensorflow/lite/testing/op_tests/shape.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/sigmoid.py b/tensorflow/lite/testing/op_tests/sigmoid.py index d13bb4ad8e4..618d415d757 100644 --- a/tensorflow/lite/testing/op_tests/sigmoid.py +++ b/tensorflow/lite/testing/op_tests/sigmoid.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/slice.py b/tensorflow/lite/testing/op_tests/slice.py index adfa5781117..d751aea916d 100644 --- a/tensorflow/lite/testing/op_tests/slice.py +++ b/tensorflow/lite/testing/op_tests/slice.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/softmax.py b/tensorflow/lite/testing/op_tests/softmax.py index 9e9e87cb8ad..61bcde058d6 100644 --- a/tensorflow/lite/testing/op_tests/softmax.py +++ b/tensorflow/lite/testing/op_tests/softmax.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/space_to_batch_nd.py b/tensorflow/lite/testing/op_tests/space_to_batch_nd.py index 114f0841ae7..bebd80ad150 100644 --- a/tensorflow/lite/testing/op_tests/space_to_batch_nd.py +++ b/tensorflow/lite/testing/op_tests/space_to_batch_nd.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/space_to_depth.py b/tensorflow/lite/testing/op_tests/space_to_depth.py index b1a0864a037..f0de487dbeb 100644 --- a/tensorflow/lite/testing/op_tests/space_to_depth.py +++ b/tensorflow/lite/testing/op_tests/space_to_depth.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/sparse_to_dense.py b/tensorflow/lite/testing/op_tests/sparse_to_dense.py index f9e7ccbfdf2..e3888ef88de 100644 --- a/tensorflow/lite/testing/op_tests/sparse_to_dense.py +++ b/tensorflow/lite/testing/op_tests/sparse_to_dense.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_scalar_data from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests diff --git a/tensorflow/lite/testing/op_tests/split.py b/tensorflow/lite/testing/op_tests/split.py index 00f2b17af54..c0492c9bf23 100644 --- a/tensorflow/lite/testing/op_tests/split.py +++ b/tensorflow/lite/testing/op_tests/split.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/splitv.py b/tensorflow/lite/testing/op_tests/splitv.py index 8abade19c9b..e3ac796c835 100644 --- a/tensorflow/lite/testing/op_tests/splitv.py +++ b/tensorflow/lite/testing/op_tests/splitv.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/squeeze.py b/tensorflow/lite/testing/op_tests/squeeze.py index 1ac416d3a90..481dfd7612c 100644 --- a/tensorflow/lite/testing/op_tests/squeeze.py +++ b/tensorflow/lite/testing/op_tests/squeeze.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/squeeze_transpose.py b/tensorflow/lite/testing/op_tests/squeeze_transpose.py index 58682e65c50..a0de2465ca4 100644 --- a/tensorflow/lite/testing/op_tests/squeeze_transpose.py +++ b/tensorflow/lite/testing/op_tests/squeeze_transpose.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/strided_slice.py b/tensorflow/lite/testing/op_tests/strided_slice.py index 36defb52fdf..bc1b0115c24 100644 --- a/tensorflow/lite/testing/op_tests/strided_slice.py +++ b/tensorflow/lite/testing/op_tests/strided_slice.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/strided_slice_np_style.py b/tensorflow/lite/testing/op_tests/strided_slice_np_style.py index 45f2e4b867a..ac741f30000 100644 --- a/tensorflow/lite/testing/op_tests/strided_slice_np_style.py +++ b/tensorflow/lite/testing/op_tests/strided_slice_np_style.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/tanh.py b/tensorflow/lite/testing/op_tests/tanh.py index 96f306f60a7..ed2d32f0b0f 100644 --- a/tensorflow/lite/testing/op_tests/tanh.py +++ b/tensorflow/lite/testing/op_tests/tanh.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/tile.py b/tensorflow/lite/testing/op_tests/tile.py index 49d838c54ec..231c9039eb2 100644 --- a/tensorflow/lite/testing/op_tests/tile.py +++ b/tensorflow/lite/testing/op_tests/tile.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/topk.py b/tensorflow/lite/testing/op_tests/topk.py index fd2ffc1cb26..3b1547ffb14 100644 --- a/tensorflow/lite/testing/op_tests/topk.py +++ b/tensorflow/lite/testing/op_tests/topk.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/transpose.py b/tensorflow/lite/testing/op_tests/transpose.py index 9b7e026269f..1adb3389fae 100644 --- a/tensorflow/lite/testing/op_tests/transpose.py +++ b/tensorflow/lite/testing/op_tests/transpose.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/transpose_conv.py b/tensorflow/lite/testing/op_tests/transpose_conv.py index 7919763ea03..654856f0d88 100644 --- a/tensorflow/lite/testing/op_tests/transpose_conv.py +++ b/tensorflow/lite/testing/op_tests/transpose_conv.py @@ -18,7 +18,7 @@ from __future__ import division from __future__ import print_function import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/unfused_gru.py b/tensorflow/lite/testing/op_tests/unfused_gru.py index 786a429fe9a..fa495105e8c 100644 --- a/tensorflow/lite/testing/op_tests/unfused_gru.py +++ b/tensorflow/lite/testing/op_tests/unfused_gru.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/unidirectional_sequence_lstm.py b/tensorflow/lite/testing/op_tests/unidirectional_sequence_lstm.py index f82ce53ea8e..8d2dae63bca 100644 --- a/tensorflow/lite/testing/op_tests/unidirectional_sequence_lstm.py +++ b/tensorflow/lite/testing/op_tests/unidirectional_sequence_lstm.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/unidirectional_sequence_rnn.py b/tensorflow/lite/testing/op_tests/unidirectional_sequence_rnn.py index 80966905b4c..18dbad0eacd 100644 --- a/tensorflow/lite/testing/op_tests/unidirectional_sequence_rnn.py +++ b/tensorflow/lite/testing/op_tests/unidirectional_sequence_rnn.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/unique.py b/tensorflow/lite/testing/op_tests/unique.py index 14ebe6bc280..ab609ed41b7 100644 --- a/tensorflow/lite/testing/op_tests/unique.py +++ b/tensorflow/lite/testing/op_tests/unique.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/unpack.py b/tensorflow/lite/testing/op_tests/unpack.py index 0b594442654..1053d769017 100644 --- a/tensorflow/lite/testing/op_tests/unpack.py +++ b/tensorflow/lite/testing/op_tests/unpack.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/unroll_batch_matmul.py b/tensorflow/lite/testing/op_tests/unroll_batch_matmul.py index bc2c9deecbd..f74c2ea8d5c 100644 --- a/tensorflow/lite/testing/op_tests/unroll_batch_matmul.py +++ b/tensorflow/lite/testing/op_tests/unroll_batch_matmul.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/where.py b/tensorflow/lite/testing/op_tests/where.py index 06a54054a22..49802422e3f 100644 --- a/tensorflow/lite/testing/op_tests/where.py +++ b/tensorflow/lite/testing/op_tests/where.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/op_tests/zeros_like.py b/tensorflow/lite/testing/op_tests/zeros_like.py index 32b15fd1f76..e9db5502652 100644 --- a/tensorflow/lite/testing/op_tests/zeros_like.py +++ b/tensorflow/lite/testing/op_tests/zeros_like.py @@ -17,7 +17,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils import register_make_test_function diff --git a/tensorflow/lite/testing/toco_convert.py b/tensorflow/lite/testing/toco_convert.py index e8d1e8eec12..79a6eea2954 100644 --- a/tensorflow/lite/testing/toco_convert.py +++ b/tensorflow/lite/testing/toco_convert.py @@ -23,7 +23,7 @@ import tempfile import traceback import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf from tensorflow.lite.testing import zip_test_utils diff --git a/tensorflow/lite/testing/zip_test_utils.py b/tensorflow/lite/testing/zip_test_utils.py index dcfe77875ff..7ab0dc9cb69 100644 --- a/tensorflow/lite/testing/zip_test_utils.py +++ b/tensorflow/lite/testing/zip_test_utils.py @@ -30,7 +30,7 @@ import numpy as np from six import StringIO # pylint: disable=g-import-not-at-top -import tensorflow as tf +import tensorflow.compat.v1 as tf from google.protobuf import text_format from tensorflow.lite.testing import _pywrap_string_util from tensorflow.lite.testing import generate_examples_report as report_lib @@ -410,35 +410,36 @@ def make_zip_of_tests(options, # Build graph report["tf_log"] = "" report["toco_log"] = "" - tf.compat.v1.reset_default_graph() - - with tf.device("/cpu:0"): + tf.reset_default_graph() + + with tf.Graph().as_default(): + with tf.device("/cpu:0"): + try: + inputs, outputs = make_graph(param_dict_real) + except (tf.errors.UnimplementedError, + tf.errors.InvalidArgumentError, ValueError): + report["tf_log"] += traceback.format_exc() + return None, report + + sess = tf.Session() try: - inputs, outputs = make_graph(param_dict_real) + baseline_inputs, baseline_outputs = ( + make_test_inputs(param_dict_real, sess, inputs, outputs)) except (tf.errors.UnimplementedError, tf.errors.InvalidArgumentError, ValueError): report["tf_log"] += traceback.format_exc() return None, report - - sess = tf.compat.v1.Session() - try: - baseline_inputs, baseline_outputs = ( - make_test_inputs(param_dict_real, sess, inputs, outputs)) - except (tf.errors.UnimplementedError, tf.errors.InvalidArgumentError, - ValueError): - report["tf_log"] += traceback.format_exc() - return None, report - report["toco"] = report_lib.FAILED - report["tf"] = report_lib.SUCCESS - # Convert graph to toco - input_tensors = [(input_tensor.name.split(":")[0], input_tensor.shape, - input_tensor.dtype) for input_tensor in inputs] - output_tensors = [_normalize_output_name(out.name) for out in outputs] - # pylint: disable=g-long-ternary - graph_def = freeze_graph( - sess, - tf.global_variables() + inputs + - outputs) if use_frozen_graph else sess.graph_def + report["toco"] = report_lib.FAILED + report["tf"] = report_lib.SUCCESS + # Convert graph to toco + input_tensors = [(input_tensor.name.split(":")[0], input_tensor.shape, + input_tensor.dtype) for input_tensor in inputs] + output_tensors = [_normalize_output_name(out.name) for out in outputs] + # pylint: disable=g-long-ternary + graph_def = freeze_graph( + sess, + tf.global_variables() + inputs + + outputs) if use_frozen_graph else sess.graph_def if "split_tflite_lstm_inputs" in param_dict_real: extra_toco_options.split_tflite_lstm_inputs = param_dict_real[ @@ -523,10 +524,9 @@ def make_zip_of_tests(options, percent = 0 if tf_success > 0: percent = float(toco_success) / float(tf_success) * 100. - tf.compat.v1.logging.info( - ("Archive %s Considered %d graphs, %d TF evaluated graphs " - " and %d TOCO converted graphs (%.1f%%"), zip_path, total_conversions, - tf_success, toco_success, percent) + tf.logging.info(("Archive %s Considered %d graphs, %d TF evaluated graphs " + " and %d TOCO converted graphs (%.1f%%"), zip_path, + total_conversions, tf_success, toco_success, percent) tf_failures = parameter_count - tf_success -- GitLab