Python 3 Migration. //tensorflow/(tools|contrib|python)

PiperOrigin-RevId: 281786348
Change-Id: Idc03f3af289295fa478e42b2c83a4269c20b6a06
This commit is contained in:
Hye Soo Yang 2019-11-21 10:53:00 -08:00 committed by TensorFlower Gardener
parent b44cbb442a
commit 6be93e0bca
7 changed files with 61 additions and 37 deletions
tensorflow
python
autograph/utils
debug
ops/losses
profiler
BUILD
internal
tools/api/generator
tools/docs

View File

@ -48,6 +48,7 @@ py_library(
py_test(
name = "context_managers_test",
srcs = ["context_managers_test.py"],
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":utils",
@ -58,6 +59,7 @@ py_test(
py_test(
name = "misc_test",
srcs = ["misc_test.py"],
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":utils",
@ -68,6 +70,7 @@ py_test(
py_test(
name = "py_func_test",
srcs = ["py_func_test.py"],
python_version = "PY3",
srcs_version = "PY2AND3",
tags = ["no_windows"],
deps = [
@ -79,6 +82,7 @@ py_test(
py_test(
name = "type_check_test",
srcs = ["type_check_test.py"],
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":utils",
@ -89,6 +93,7 @@ py_test(
py_test(
name = "tensor_list_test",
srcs = ["tensor_list_test.py"],
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":utils",
@ -100,6 +105,7 @@ py_test(
py_test(
name = "tensors_test",
srcs = ["tensors_test.py"],
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":utils",

View File

@ -190,7 +190,7 @@ py_library(
py_binary(
name = "grpc_tensorflow_server",
srcs = ["lib/grpc_tensorflow_server.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [":grpc_tensorflow_server_lib"],
)
@ -464,7 +464,7 @@ py_library(
py_binary(
name = "offline_analyzer",
srcs = ["cli/offline_analyzer.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [":offline_analyzer_lib"],
)
@ -504,7 +504,7 @@ py_library(
py_binary(
name = "debug_fibonacci",
srcs = ["examples/v1/debug_fibonacci.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [":debug_fibonacci_lib"],
)
@ -512,7 +512,7 @@ py_binary(
py_binary(
name = "debug_fibonacci_v2",
srcs = ["examples/v2/debug_fibonacci_v2.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [":debug_fibonacci_lib"],
)
@ -535,7 +535,7 @@ py_library(
py_binary(
name = "debug_errors",
srcs = ["examples/v1/debug_errors.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [":debug_errors_lib"],
)
@ -554,7 +554,7 @@ py_library(
py_binary(
name = "debug_mnist",
srcs = ["examples/debug_mnist.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [":debug_mnist_lib"],
)
@ -562,7 +562,7 @@ py_binary(
py_binary(
name = "debug_mnist_v1",
srcs = ["examples/v1/debug_mnist_v1.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [":debug_mnist_lib"],
)
@ -570,7 +570,7 @@ py_binary(
py_binary(
name = "debug_mnist_v2",
srcs = ["examples/v2/debug_mnist_v2.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [":debug_mnist_lib"],
)
@ -592,7 +592,7 @@ py_library(
py_binary(
name = "debug_tflearn_iris",
srcs = ["examples/v1/debug_tflearn_iris.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [":debug_tflearn_iris_lib"],
)
@ -611,7 +611,7 @@ py_library(
py_binary(
name = "debug_keras",
srcs = ["examples/v1/debug_keras.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [":debug_keras_lib"],
)
@ -631,7 +631,7 @@ py_test(
name = "common_test",
size = "small",
srcs = ["lib/common_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":common",
@ -664,7 +664,7 @@ py_test(
name = "debug_graphs_test",
size = "small",
srcs = ["lib/debug_graphs_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":debug_graphs",
@ -677,7 +677,7 @@ py_test(
name = "debug_data_test",
size = "small",
srcs = ["lib/debug_data_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":debug_data",
@ -702,6 +702,7 @@ cuda_py_test(
"//tensorflow/python:platform_test",
"//tensorflow/python:variables",
],
python_version = "PY3",
)
cuda_py_test(
@ -723,6 +724,7 @@ cuda_py_test(
"//tensorflow/python/distribute:strategy_combinations",
"//tensorflow/python/keras",
],
python_version = "PY3",
tags = [
"guitar",
"multi_and_single_gpu",
@ -749,6 +751,7 @@ cuda_py_test(
"//tensorflow/python:variables",
"//tensorflow/python/keras",
],
python_version = "PY3",
shard_count = 8,
tags = [
"no_windows", # TODO(b/142475891): Enable this test on Windows.
@ -774,6 +777,7 @@ cuda_py_test(
"//tensorflow/python/data/ops:dataset_ops",
"//tensorflow/python/keras",
],
python_version = "PY3",
tags = [
"no_windows", # b/142475891
],
@ -795,6 +799,7 @@ cuda_py_test(
"//tensorflow/python:training",
"//tensorflow/python:variables",
],
python_version = "PY3",
xla_enable_strict_auto_jit = False, # Node names are different with autojit
)
@ -802,7 +807,7 @@ py_test(
name = "debug_utils_test",
size = "small",
srcs = ["lib/debug_utils_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":debug_utils",
@ -822,7 +827,7 @@ py_test(
name = "source_utils_test",
size = "small",
srcs = ["lib/source_utils_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":debug_data",
@ -849,7 +854,7 @@ py_test(
name = "source_remote_test",
size = "small",
srcs = ["lib/source_remote_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
tags = [
"no_windows",
@ -876,7 +881,7 @@ py_test(
name = "framework_test",
size = "medium",
srcs = ["wrappers/framework_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":debug_data",
@ -901,7 +906,7 @@ py_test(
name = "profiling_test",
size = "small",
srcs = ["lib/profiling_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":profiling",
@ -915,7 +920,7 @@ py_test(
name = "curses_ui_test",
size = "small",
srcs = ["cli/curses_ui_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
tags = [
"no_windows",
@ -936,7 +941,7 @@ py_test(
name = "readline_ui_test",
size = "small",
srcs = ["cli/readline_ui_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":cli_config",
@ -1031,6 +1036,7 @@ cuda_py_test(
"//tensorflow/python:platform_test",
"//tensorflow/python:variables",
],
python_version = "PY3",
xla_enable_strict_auto_jit = False, # Tests TF:Classic implementation.
)
@ -1048,6 +1054,7 @@ cuda_py_test(
"//tensorflow/python:platform_test",
"//tensorflow/python:variables",
],
python_version = "PY3",
tags = ["notsan"],
xla_enable_strict_auto_jit = False, # Node names are different with autojit
)
@ -1067,6 +1074,7 @@ cuda_py_test(
"//tensorflow/python:training",
"//tensorflow/python:variables",
],
python_version = "PY3",
xla_enable_strict_auto_jit = False, # Node names are different with autojit
)
@ -1084,6 +1092,7 @@ cuda_py_test(
"//tensorflow/python:platform_test",
"//tensorflow/python:variables",
],
python_version = "PY3",
tags = ["no_windows_gpu"],
xla_enable_strict_auto_jit = False, # Node names are different with autojit
)
@ -1092,7 +1101,7 @@ py_test(
name = "debugger_cli_common_test",
size = "small",
srcs = ["cli/debugger_cli_common_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":debugger_cli_common",
@ -1107,7 +1116,7 @@ py_test(
name = "cli_config_test",
size = "small",
srcs = ["cli/cli_config_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":cli_config",
@ -1121,7 +1130,7 @@ py_test(
name = "command_parser_test",
size = "small",
srcs = ["cli/command_parser_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":command_parser",
@ -1134,7 +1143,7 @@ py_test(
name = "tensor_format_test",
size = "small",
srcs = ["cli/tensor_format_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":cli_test_utils",
@ -1152,7 +1161,7 @@ py_test(
name = "cli_shared_test",
size = "small",
srcs = ["cli/cli_shared_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":cli_shared",
@ -1172,7 +1181,7 @@ py_test(
srcs = [
"cli/evaluator_test.py",
],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":debug_data",
@ -1216,6 +1225,7 @@ cuda_py_test(
"//tensorflow/python:util",
"//tensorflow/python:variables",
],
python_version = "PY3",
tags = ["no_windows"], # TODO: needs investigation on Windows
xla_enable_strict_auto_jit = False, # Node names are different with autojit
)
@ -1224,7 +1234,7 @@ py_test(
name = "profile_analyzer_cli_test",
size = "small",
srcs = ["cli/profile_analyzer_cli_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":debugger_cli_common",
@ -1260,6 +1270,7 @@ cuda_py_test(
"//tensorflow/python:platform_test",
"//tensorflow/python:variables",
],
python_version = "PY3",
tags = [
"no_oss", # Test flaky due to port collisions.
"no_windows",
@ -1285,6 +1296,7 @@ cuda_py_test(
"//tensorflow/python:platform_test",
"//tensorflow/python:variables",
],
python_version = "PY3",
tags = [
"no_oss", # Test flaky due to port collisions.
"no_windows",
@ -1315,6 +1327,7 @@ cuda_py_test(
"//tensorflow/python:variables",
],
grpc_enabled = True,
python_version = "PY3",
tags = [
"no_oss", # Incompatible with bazel_pip.
"no_windows",
@ -1327,7 +1340,7 @@ py_test(
name = "dumping_wrapper_test",
size = "small",
srcs = ["wrappers/dumping_wrapper_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":debug_data",
@ -1350,7 +1363,7 @@ py_test(
name = "local_cli_wrapper_test",
size = "small",
srcs = ["wrappers/local_cli_wrapper_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":cli_shared",
@ -1379,7 +1392,7 @@ py_test(
name = "disk_usage_test",
size = "small",
srcs = ["wrappers/disk_usage_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":dumping_wrapper",

View File

@ -41,7 +41,7 @@ py_test(
name = "util_test",
size = "small",
srcs = ["util_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":losses",

View File

@ -57,6 +57,7 @@ cuda_py_test(
"//tensorflow/python:platform",
"//tensorflow/python:variables",
],
python_version = "PY3",
tags = [
"no_pip",
"notap",
@ -77,6 +78,7 @@ cuda_py_test(
"//tensorflow/python/profiler/internal:model_analyzer_testlib",
"//tensorflow/python:variables",
],
python_version = "PY3",
tags = ["no_pip"],
xla_enable_strict_auto_jit = False, # Node names are different with autojit
)
@ -108,6 +110,7 @@ tf_py_test(
"//tensorflow/python:framework_for_generated_wrappers",
"//tensorflow/python:math_ops",
],
python_version = "PY3",
)
py_library(
@ -132,6 +135,7 @@ cuda_py_test(
"//tensorflow/python/profiler/internal:model_analyzer_testlib",
"//tensorflow/python:variables",
],
python_version = "PY3",
tags = [
"no_gpu", # b/136036359
"no_pip",
@ -151,7 +155,7 @@ py_test(
size = "small",
srcs = ["pprof_profiler_test.py"],
main = "pprof_profiler_test.py",
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
tags = ["no_pip"], # TODO(annarev): get it working with pip.
deps = [

View File

@ -40,7 +40,7 @@ py_library(
py_test(
name = "print_model_analysis_test",
srcs = ["print_model_analysis_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
"//tensorflow/core/profiler:protos_all_py",
@ -67,6 +67,7 @@ cuda_py_test(
"//tensorflow/python/profiler:model_analyzer",
"//tensorflow/python:random_ops",
],
python_version = "PY3",
tags = [
"no_gpu", # b/138442728
"no_pip",

View File

@ -45,7 +45,7 @@ py_test(
"create_python_api.py",
"create_python_api_test.py",
],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":doc_srcs",
@ -62,7 +62,7 @@ py_test(
"--api_name=tensorflow",
] + KERAS_API_INIT_FILES + KERAS_API_INIT_FILES_V1 + TENSORFLOW_API_INIT_FILES + TENSORFLOW_API_INIT_FILES_V1,
main = "doc_srcs_test.py",
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":doc_srcs",
@ -78,7 +78,7 @@ py_test(
"api_init_files.bzl",
"api_init_files_v1.bzl",
],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
tags = [
"no_pip",

View File

@ -151,7 +151,7 @@ py_test(
name = "generate2_test",
size = "medium",
srcs = ["generate2_test.py"],
python_version = "PY2",
python_version = "PY3",
srcs_version = "PY2AND3",
tags = [
"manual",