From aa35dc27617676322972f2fd482ed43a7a7e1d16 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Mon, 22 Jan 2024 17:58:52 -0800 Subject: [PATCH] Remove Estimator from Tensorflow. The change was made public in TensorFlow 2.14 and 2.15 release notes: https://github.com/tensorflow/tensorflow/releases PiperOrigin-RevId: 600623585 --- .../devel.usertools/wheel_verification.bats | 6 - ci/official/requirements_updater/BUILD.bazel | 4 - ci/official/requirements_updater/README.md | 1 - .../requirements_updater/requirements.in | 3 +- requirements_lock_3_10.txt | 3 - requirements_lock_3_11.txt | 3 - requirements_lock_3_12.txt | 3 - requirements_lock_3_9.txt | 3 - tensorflow/BUILD | 3 +- tensorflow/api_template.__init__.py | 17 - tensorflow/api_template_v1.__init__.py | 14 - tensorflow/compat_template.__init__.py | 16 - tensorflow/compat_template_v1.__init__.py | 16 - tensorflow/lite/g3doc/r1/convert/index.md | 2 +- tensorflow/lite/python/BUILD | 1 - tensorflow/lite/python/lite.py | 2 - tensorflow/lite/toco/README.md | 4 +- tensorflow/lite/tutorials/BUILD | 2 - tensorflow/python/BUILD | 5 - tensorflow/python/compiler/tensorrt/BUILD | 59 - .../python/compiler/tensorrt/test/BUILD | 16 - .../tensorrt/test/quantization_mnist_test.py | 411 --- tensorflow/python/compiler/xla/BUILD | 3 +- .../python/compiler/xla/tests/xla_test.py | 5 +- tensorflow/python/compiler/xla/xla.py | 15 - .../python/data/experimental/__init__.py | 2 - .../data/experimental/kernel_tests/BUILD | 24 - .../checkpoint_input_pipeline_hook_test.py | 127 - tensorflow/python/data/experimental/ops/BUILD | 5 - .../experimental/ops/get_single_element.py | 38 - .../data/experimental/ops/iterator_ops.py | 224 -- .../python/data/experimental/ops/readers.py | 4 +- .../python/data/kernel_tests/dataset_test.py | 4 +- tensorflow/python/data/ops/dataset_ops.py | 44 +- tensorflow/python/debug/examples/v1/BUILD | 27 - .../debug/examples/v1/debug_tflearn_iris.py | 145 - .../v1/examples_v1_debug_tflearn_iris_test.sh | 70 - tensorflow/python/debug/wrappers/hooks.py | 11 +- tensorflow/python/distribute/BUILD | 23 - tensorflow/python/distribute/README.md | 4 +- tensorflow/python/distribute/__init__.py | 7 +- .../collective_all_reduce_strategy.py | 5 +- .../collective_all_reduce_strategy_test.py | 1 - .../python/distribute/distribute_lib.py | 12 +- .../python/distribute/distribute_utils.py | 3 - .../distribute/distribute_utils_test.py | 51 - .../python/distribute/estimator_training.py | 387 --- .../python/distribute/multi_worker_util.py | 2 +- .../parameter_server_strategy_test.py | 7 +- tensorflow/python/distribute/tpu_strategy.py | 2 +- tensorflow/python/estimator/BUILD | 388 --- .../python/estimator/canned/baseline.py | 28 - tensorflow/python/estimator/canned/dnn.py | 28 - .../estimator/canned/dnn_linear_combined.py | 30 - .../estimator/canned/dnn_testing_utils.py | 30 - tensorflow/python/estimator/canned/head.py | 28 - tensorflow/python/estimator/canned/linear.py | 28 - .../estimator/canned/linear_testing_utils.py | 30 - .../python/estimator/canned/metric_keys.py | 28 - .../python/estimator/canned/optimizers.py | 28 - .../python/estimator/canned/parsing_utils.py | 30 - .../estimator/canned/prediction_keys.py | 30 - tensorflow/python/estimator/estimator.py | 28 - tensorflow/python/estimator/estimator_lib.py | 30 - tensorflow/python/estimator/export/export.py | 28 - .../python/estimator/export/export_lib.py | 28 - .../python/estimator/export/export_output.py | 30 - tensorflow/python/estimator/exporter.py | 28 - tensorflow/python/estimator/gc.py | 28 - tensorflow/python/estimator/inputs/inputs.py | 28 - .../python/estimator/inputs/numpy_io.py | 28 - .../python/estimator/inputs/pandas_io.py | 28 - .../estimator/inputs/queues/__init__.py | 28 - .../inputs/queues/feeding_functions.py | 30 - .../inputs/queues/feeding_queue_runner.py | 30 - tensorflow/python/estimator/keras.py | 28 - tensorflow/python/estimator/model_fn.py | 28 - tensorflow/python/estimator/run_config.py | 28 - tensorflow/python/estimator/training.py | 28 - tensorflow/python/estimator/util.py | 28 - .../python/feature_column/feature_column.py | 131 - .../feature_column/feature_column_v2.py | 208 +- tensorflow/python/framework/BUILD | 1 - .../python/framework/op_callbacks_test.py | 2 - tensorflow/python/framework/ops.py | 13 +- .../python/keras/engine/base_layer_utils.py | 2 - .../python/keras/engine/base_layer_v1.py | 11 +- tensorflow/python/keras/engine/training_v1.py | 6 +- tensorflow/python/keras/regularizers.py | 21 +- .../keras/saving/saved_model_experimental.py | 8 +- .../python/keras/saving/saving_utils.py | 3 +- .../python/keras/saving/utils_v1/__init__.py | 2 +- .../keras/saving/utils_v1/export_utils.py | 4 +- .../python/keras/saving/utils_v1/mode_keys.py | 30 +- .../control_flow/control_flow_ops_py_test.py | 4 - tensorflow/python/ops/BUILD | 5 +- tensorflow/python/ops/clustering_ops.py | 1 - tensorflow/python/ops/control_flow_util_v2.py | 18 +- tensorflow/python/ops/script_ops.py | 6 +- tensorflow/python/ops/while_v2.py | 2 - tensorflow/python/saved_model/load.py | 12 +- tensorflow/python/saved_model/loader_impl.py | 2 - .../saved_model/model_utils/__init__.py | 2 +- .../saved_model/model_utils/export_utils.py | 6 +- tensorflow/python/saved_model/simple_save.py | 5 +- .../python/tools/api/generator/api_gen.bzl | 4 +- .../tools/api/generator/create_python_api.py | 12 +- .../python/tools/api/generator/doc_srcs.py | 2 - .../tools/api/generator/doc_srcs_test.py | 2 +- .../python/tools/api/generator2/apis.bzl | 6 - .../generator2/extractor/extractor_test.py | 8 - tensorflow/python/tools/module_util.py | 5 +- tensorflow/python/tpu/BUILD | 30 +- tensorflow/python/tpu/api.py | 2 +- tensorflow/python/tpu/feature_column.py | 35 - tensorflow/python/tpu/ops/tpu_ops.py | 6 +- tensorflow/python/tpu/session_support.py | 448 --- tensorflow/python/tpu/tests/BUILD | 31 - .../tests/tpu_embedding_v2_optimizer_test.py | 201 -- tensorflow/python/tpu/tpu_embedding.py | 3025 ----------------- .../python/tpu/tpu_embedding_gradient.py | 184 - tensorflow/python/tpu/tpu_function.py | 7 +- tensorflow/python/tpu/tpu_optimizer.py | 3 - tensorflow/python/tpu/tpu_replication.py | 11 +- tensorflow/python/training/device_setter.py | 2 - tensorflow/python/training/optimizer.py | 9 +- tensorflow/python/training/saver.py | 8 +- .../training/sync_replicas_optimizer.py | 7 - .../training/sync_replicas_optimizer_test.py | 1 - tensorflow/python/training/training_util.py | 4 +- tensorflow/python/util/BUILD | 14 - tensorflow/python/util/deprecation.py | 4 - tensorflow/python/util/deprecation_wrapper.py | 24 - tensorflow/python/util/function_utils_test.py | 2 +- tensorflow/python/util/tf_export.py | 46 +- tensorflow/python/util/tf_export_test.py | 10 - ...ntal.-checkpoint-input-pipeline-hook.pbtxt | 30 - .../v1/tensorflow.data.experimental.pbtxt | 4 - ...rflow.estimator.-baseline-classifier.pbtxt | 66 - ...orflow.estimator.-baseline-estimator.pbtxt | 66 - ...orflow.estimator.-baseline-regressor.pbtxt | 66 - .../tensorflow.estimator.-best-exporter.pbtxt | 18 - ...sorflow.estimator.-binary-class-head.pbtxt | 42 - ...low.estimator.-checkpoint-saver-hook.pbtxt | 30 - ...estimator.-checkpoint-saver-listener.pbtxt | 24 - ...nsorflow.estimator.-d-n-n-classifier.pbtxt | 66 - ...ensorflow.estimator.-d-n-n-estimator.pbtxt | 66 - ...or.-d-n-n-linear-combined-classifier.pbtxt | 66 - ...tor.-d-n-n-linear-combined-estimator.pbtxt | 66 - ...tor.-d-n-n-linear-combined-regressor.pbtxt | 66 - ...ensorflow.estimator.-d-n-n-regressor.pbtxt | 66 - ...tensorflow.estimator.-estimator-spec.pbtxt | 59 - .../v1/tensorflow.estimator.-estimator.pbtxt | 65 - .../v1/tensorflow.estimator.-eval-spec.pbtxt | 43 - .../v1/tensorflow.estimator.-exporter.pbtxt | 16 - .../tensorflow.estimator.-feed-fn-hook.pbtxt | 30 - ...tensorflow.estimator.-final-exporter.pbtxt | 18 - ...tensorflow.estimator.-final-ops-hook.pbtxt | 34 - ...w.estimator.-global-step-waiter-hook.pbtxt | 30 - .../v1/tensorflow.estimator.-head.pbtxt | 40 - ...ensorflow.estimator.-latest-exporter.pbtxt | 18 - ...sorflow.estimator.-linear-classifier.pbtxt | 66 - ...nsorflow.estimator.-linear-estimator.pbtxt | 66 - ...nsorflow.estimator.-linear-regressor.pbtxt | 66 - ...rflow.estimator.-logging-tensor-hook.pbtxt | 30 - ....estimator.-logistic-regression-head.pbtxt | 43 - .../v1/tensorflow.estimator.-mode-keys.pbtxt | 20 - ...nsorflow.estimator.-multi-class-head.pbtxt | 42 - .../v1/tensorflow.estimator.-multi-head.pbtxt | 42 - ...nsorflow.estimator.-multi-label-head.pbtxt | 42 - ...ator.-nan-loss-during-training-error.pbtxt | 15 - ...ensorflow.estimator.-nan-tensor-hook.pbtxt | 30 - ...w.estimator.-poisson-regression-head.pbtxt | 43 - .../tensorflow.estimator.-profiler-hook.pbtxt | 30 - ...ensorflow.estimator.-regression-head.pbtxt | 42 - .../v1/tensorflow.estimator.-run-config.pbtxt | 117 - ...flow.estimator.-second-or-step-timer.pbtxt | 26 - ...nsorflow.estimator.-session-run-args.pbtxt | 27 - ...rflow.estimator.-session-run-context.pbtxt | 25 - ...nsorflow.estimator.-session-run-hook.pbtxt | 28 - ...orflow.estimator.-session-run-values.pbtxt | 27 - ...sorflow.estimator.-step-counter-hook.pbtxt | 30 - ...sorflow.estimator.-stop-at-step-hook.pbtxt | 30 - ...orflow.estimator.-summary-saver-hook.pbtxt | 30 - .../v1/tensorflow.estimator.-train-spec.pbtxt | 31 - .../v1/tensorflow.estimator.-vocab-info.pbtxt | 43 - ...rflow.estimator.-warm-start-settings.pbtxt | 31 - ...perimental.-in-memory-evaluator-hook.pbtxt | 30 - ...flow.estimator.experimental.-k-means.pbtxt | 114 - ...timator.experimental.-linear-s-d-c-a.pbtxt | 13 - .../tensorflow.estimator.experimental.pbtxt | 55 - ...-classification-output.__metaclass__.pbtxt | 14 - ...imator.export.-classification-output.pbtxt | 22 - ...or.export.-eval-output.__metaclass__.pbtxt | 14 - ...orflow.estimator.export.-eval-output.pbtxt | 47 - ....export.-export-output.__metaclass__.pbtxt | 14 - ...flow.estimator.export.-export-output.pbtxt | 12 - ...export.-predict-output.__metaclass__.pbtxt | 14 - ...low.estimator.export.-predict-output.pbtxt | 18 - ...ort.-regression-output.__metaclass__.pbtxt | 14 - ....estimator.export.-regression-output.pbtxt | 18 - ...mator.export.-serving-input-receiver.pbtxt | 27 - ...xport.-tensor-serving-input-receiver.pbtxt | 27 - .../v1/tensorflow.estimator.export.pbtxt | 39 - .../v1/tensorflow.estimator.inputs.pbtxt | 11 - .../api/golden/v1/tensorflow.estimator.pbtxt | 231 -- ...estimator.tpu.-input-pipeline-config.pbtxt | 28 - ...tensorflow.estimator.tpu.-run-config.pbtxt | 126 - ...nsorflow.estimator.tpu.-t-p-u-config.pbtxt | 59 - ....estimator.tpu.-t-p-u-estimator-spec.pbtxt | 64 - ...rflow.estimator.tpu.-t-p-u-estimator.pbtxt | 66 - ....experimental.-embedding-config-spec.pbtxt | 55 - ...ensorflow.estimator.tpu.experimental.pbtxt | 7 - .../golden/v1/tensorflow.estimator.tpu.pbtxt | 27 - .../tools/api/golden/v1/tensorflow.pbtxt | 4 - ...tpu.experimental.-adagrad-parameters.pbtxt | 10 - ...ow.tpu.experimental.-adam-parameters.pbtxt | 10 - ...ow.tpu.experimental.-ftrl-parameters.pbtxt | 10 - ...ochastic-gradient-descent-parameters.pbtxt | 10 - .../v1/tensorflow.tpu.experimental.pbtxt | 16 - ...ntal.-checkpoint-input-pipeline-hook.pbtxt | 30 - .../v2/tensorflow.data.experimental.pbtxt | 4 - ...rflow.estimator.-baseline-classifier.pbtxt | 63 - ...orflow.estimator.-baseline-estimator.pbtxt | 63 - ...orflow.estimator.-baseline-regressor.pbtxt | 63 - .../tensorflow.estimator.-best-exporter.pbtxt | 18 - ...sorflow.estimator.-binary-class-head.pbtxt | 42 - ...low.estimator.-checkpoint-saver-hook.pbtxt | 30 - ...estimator.-checkpoint-saver-listener.pbtxt | 24 - ...nsorflow.estimator.-d-n-n-classifier.pbtxt | 63 - ...ensorflow.estimator.-d-n-n-estimator.pbtxt | 63 - ...or.-d-n-n-linear-combined-classifier.pbtxt | 63 - ...tor.-d-n-n-linear-combined-estimator.pbtxt | 63 - ...tor.-d-n-n-linear-combined-regressor.pbtxt | 63 - ...ensorflow.estimator.-d-n-n-regressor.pbtxt | 63 - ...tensorflow.estimator.-estimator-spec.pbtxt | 59 - .../v2/tensorflow.estimator.-estimator.pbtxt | 62 - .../v2/tensorflow.estimator.-eval-spec.pbtxt | 43 - .../v2/tensorflow.estimator.-exporter.pbtxt | 16 - .../tensorflow.estimator.-feed-fn-hook.pbtxt | 30 - ...tensorflow.estimator.-final-exporter.pbtxt | 18 - ...tensorflow.estimator.-final-ops-hook.pbtxt | 34 - ...w.estimator.-global-step-waiter-hook.pbtxt | 30 - .../v2/tensorflow.estimator.-head.pbtxt | 40 - ...ensorflow.estimator.-latest-exporter.pbtxt | 18 - ...sorflow.estimator.-linear-classifier.pbtxt | 63 - ...nsorflow.estimator.-linear-estimator.pbtxt | 63 - ...nsorflow.estimator.-linear-regressor.pbtxt | 63 - ...rflow.estimator.-logging-tensor-hook.pbtxt | 30 - ....estimator.-logistic-regression-head.pbtxt | 43 - .../v2/tensorflow.estimator.-mode-keys.pbtxt | 20 - ...nsorflow.estimator.-multi-class-head.pbtxt | 42 - .../v2/tensorflow.estimator.-multi-head.pbtxt | 42 - ...nsorflow.estimator.-multi-label-head.pbtxt | 42 - ...ator.-nan-loss-during-training-error.pbtxt | 15 - ...ensorflow.estimator.-nan-tensor-hook.pbtxt | 30 - ...w.estimator.-poisson-regression-head.pbtxt | 43 - .../tensorflow.estimator.-profiler-hook.pbtxt | 30 - ...ensorflow.estimator.-regression-head.pbtxt | 42 - .../v2/tensorflow.estimator.-run-config.pbtxt | 117 - ...flow.estimator.-second-or-step-timer.pbtxt | 26 - ...nsorflow.estimator.-session-run-args.pbtxt | 27 - ...rflow.estimator.-session-run-context.pbtxt | 25 - ...nsorflow.estimator.-session-run-hook.pbtxt | 28 - ...orflow.estimator.-session-run-values.pbtxt | 27 - ...sorflow.estimator.-step-counter-hook.pbtxt | 30 - ...sorflow.estimator.-stop-at-step-hook.pbtxt | 30 - ...orflow.estimator.-summary-saver-hook.pbtxt | 30 - .../v2/tensorflow.estimator.-train-spec.pbtxt | 31 - .../v2/tensorflow.estimator.-vocab-info.pbtxt | 43 - ...rflow.estimator.-warm-start-settings.pbtxt | 31 - ...perimental.-in-memory-evaluator-hook.pbtxt | 30 - ...timator.experimental.-linear-s-d-c-a.pbtxt | 13 - ...mator.experimental.-r-n-n-classifier.pbtxt | 67 - ...imator.experimental.-r-n-n-estimator.pbtxt | 66 - .../tensorflow.estimator.experimental.pbtxt | 51 - ...-classification-output.__metaclass__.pbtxt | 14 - ...imator.export.-classification-output.pbtxt | 22 - ...or.export.-eval-output.__metaclass__.pbtxt | 14 - ...orflow.estimator.export.-eval-output.pbtxt | 47 - ....export.-export-output.__metaclass__.pbtxt | 14 - ...flow.estimator.export.-export-output.pbtxt | 12 - ...export.-predict-output.__metaclass__.pbtxt | 14 - ...low.estimator.export.-predict-output.pbtxt | 18 - ...ort.-regression-output.__metaclass__.pbtxt | 14 - ....estimator.export.-regression-output.pbtxt | 18 - ...mator.export.-serving-input-receiver.pbtxt | 27 - ...xport.-tensor-serving-input-receiver.pbtxt | 27 - .../v2/tensorflow.estimator.export.pbtxt | 39 - .../api/golden/v2/tensorflow.estimator.pbtxt | 223 -- .../tools/api/golden/v2/tensorflow.pbtxt | 4 - tensorflow/tools/api/tests/BUILD | 2 - .../tools/api/tests/api_compatibility_test.py | 10 +- .../install/install_centos_pip_packages.sh | 4 - .../ci_build/install/install_pip_packages.sh | 3 - .../install_pip_packages_by_version.sh | 1 - .../tools/ci_build/linux/gpu/run_mkl.sh | 5 +- .../ci_build/release/requirements_common.txt | 3 +- .../tools/compatibility/all_renames_v2.py | 25 - tensorflow/tools/compatibility/renames_v2.py | 138 +- tensorflow/tools/compatibility/reorders_v2.py | 22 +- .../tools/compatibility/tf_upgrade_v2.py | 174 - .../tools/compatibility/tf_upgrade_v2_test.py | 217 +- tensorflow/tools/compatibility/update/BUILD | 8 +- .../update/generate_v2_renames_map.py | 3 - .../update/generate_v2_reorders_map.py | 2 - tensorflow/tools/docs/BUILD | 6 +- tensorflow/tools/docs/base_dir.py | 5 - tensorflow/tools/docs/generate2.py | 6 +- tensorflow/tools/docs/generate2_test.py | 2 - tensorflow/tools/pip_package/setup.py | 5 - tensorflow/tools/pip_package/v2/setup.py | 5 - .../devel.requirements.txt | 3 +- .../devel.usertools/wheel_verification.bats | 6 - .../virtual_root_template_v1.__init__.py | 27 +- .../virtual_root_template_v2.__init__.py | 20 +- 316 files changed, 170 insertions(+), 14409 deletions(-) delete mode 100644 tensorflow/python/compiler/tensorrt/test/quantization_mnist_test.py delete mode 100644 tensorflow/python/data/experimental/kernel_tests/checkpoint_input_pipeline_hook_test.py delete mode 100644 tensorflow/python/debug/examples/v1/debug_tflearn_iris.py delete mode 100755 tensorflow/python/debug/examples/v1/examples_v1_debug_tflearn_iris_test.sh delete mode 100644 tensorflow/python/distribute/estimator_training.py delete mode 100644 tensorflow/python/estimator/BUILD delete mode 100644 tensorflow/python/estimator/canned/baseline.py delete mode 100644 tensorflow/python/estimator/canned/dnn.py delete mode 100644 tensorflow/python/estimator/canned/dnn_linear_combined.py delete mode 100644 tensorflow/python/estimator/canned/dnn_testing_utils.py delete mode 100644 tensorflow/python/estimator/canned/head.py delete mode 100644 tensorflow/python/estimator/canned/linear.py delete mode 100644 tensorflow/python/estimator/canned/linear_testing_utils.py delete mode 100644 tensorflow/python/estimator/canned/metric_keys.py delete mode 100644 tensorflow/python/estimator/canned/optimizers.py delete mode 100644 tensorflow/python/estimator/canned/parsing_utils.py delete mode 100644 tensorflow/python/estimator/canned/prediction_keys.py delete mode 100644 tensorflow/python/estimator/estimator.py delete mode 100644 tensorflow/python/estimator/estimator_lib.py delete mode 100644 tensorflow/python/estimator/export/export.py delete mode 100644 tensorflow/python/estimator/export/export_lib.py delete mode 100644 tensorflow/python/estimator/export/export_output.py delete mode 100644 tensorflow/python/estimator/exporter.py delete mode 100644 tensorflow/python/estimator/gc.py delete mode 100644 tensorflow/python/estimator/inputs/inputs.py delete mode 100644 tensorflow/python/estimator/inputs/numpy_io.py delete mode 100644 tensorflow/python/estimator/inputs/pandas_io.py delete mode 100644 tensorflow/python/estimator/inputs/queues/__init__.py delete mode 100644 tensorflow/python/estimator/inputs/queues/feeding_functions.py delete mode 100644 tensorflow/python/estimator/inputs/queues/feeding_queue_runner.py delete mode 100644 tensorflow/python/estimator/keras.py delete mode 100644 tensorflow/python/estimator/model_fn.py delete mode 100644 tensorflow/python/estimator/run_config.py delete mode 100644 tensorflow/python/estimator/training.py delete mode 100644 tensorflow/python/estimator/util.py delete mode 100644 tensorflow/python/tpu/session_support.py delete mode 100644 tensorflow/python/tpu/tests/tpu_embedding_v2_optimizer_test.py delete mode 100644 tensorflow/python/tpu/tpu_embedding.py delete mode 100644 tensorflow/python/tpu/tpu_embedding_gradient.py delete mode 100644 tensorflow/python/util/deprecation_wrapper.py delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.data.experimental.-checkpoint-input-pipeline-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-baseline-classifier.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-baseline-estimator.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-baseline-regressor.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-best-exporter.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-binary-class-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-checkpoint-saver-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-checkpoint-saver-listener.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-classifier.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-estimator.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-linear-combined-classifier.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-linear-combined-estimator.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-linear-combined-regressor.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-regressor.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-estimator-spec.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-estimator.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-eval-spec.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-exporter.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-feed-fn-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-final-exporter.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-final-ops-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-global-step-waiter-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-latest-exporter.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-linear-classifier.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-linear-estimator.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-linear-regressor.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-logging-tensor-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-logistic-regression-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-mode-keys.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-multi-class-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-multi-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-multi-label-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-nan-loss-during-training-error.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-nan-tensor-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-poisson-regression-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-profiler-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-regression-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-run-config.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-second-or-step-timer.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-args.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-context.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-values.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-step-counter-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-stop-at-step-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-summary-saver-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-train-spec.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-vocab-info.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.-warm-start-settings.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.-in-memory-evaluator-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.-k-means.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.-linear-s-d-c-a.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-classification-output.__metaclass__.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-classification-output.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-eval-output.__metaclass__.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-eval-output.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-export-output.__metaclass__.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-export-output.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-predict-output.__metaclass__.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-predict-output.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-regression-output.__metaclass__.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-regression-output.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-serving-input-receiver.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-tensor-serving-input-receiver.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.export.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.inputs.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-input-pipeline-config.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-run-config.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-t-p-u-config.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-t-p-u-estimator-spec.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-t-p-u-estimator.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.experimental.-embedding-config-spec.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.experimental.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-adagrad-parameters.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-adam-parameters.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-ftrl-parameters.pbtxt delete mode 100644 tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-stochastic-gradient-descent-parameters.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.data.experimental.-checkpoint-input-pipeline-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-baseline-classifier.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-baseline-estimator.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-baseline-regressor.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-best-exporter.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-binary-class-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-checkpoint-saver-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-checkpoint-saver-listener.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-classifier.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-estimator.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-linear-combined-classifier.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-linear-combined-estimator.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-linear-combined-regressor.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-regressor.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-estimator-spec.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-estimator.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-eval-spec.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-exporter.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-feed-fn-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-final-exporter.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-final-ops-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-global-step-waiter-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-latest-exporter.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-linear-classifier.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-linear-estimator.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-linear-regressor.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-logging-tensor-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-logistic-regression-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-mode-keys.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-multi-class-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-multi-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-multi-label-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-nan-loss-during-training-error.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-nan-tensor-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-poisson-regression-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-profiler-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-regression-head.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-run-config.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-second-or-step-timer.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-args.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-context.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-values.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-step-counter-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-stop-at-step-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-summary-saver-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-train-spec.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-vocab-info.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.-warm-start-settings.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-in-memory-evaluator-hook.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-linear-s-d-c-a.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-r-n-n-classifier.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-r-n-n-estimator.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-classification-output.__metaclass__.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-classification-output.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-eval-output.__metaclass__.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-eval-output.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-export-output.__metaclass__.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-export-output.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-predict-output.__metaclass__.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-predict-output.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-regression-output.__metaclass__.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-regression-output.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-serving-input-receiver.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-tensor-serving-input-receiver.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.export.pbtxt delete mode 100644 tensorflow/tools/api/golden/v2/tensorflow.estimator.pbtxt diff --git a/ci/official/containers/linux_arm64/devel.usertools/wheel_verification.bats b/ci/official/containers/linux_arm64/devel.usertools/wheel_verification.bats index 715eb4ff334..3f83d9a50ad 100644 --- a/ci/official/containers/linux_arm64/devel.usertools/wheel_verification.bats +++ b/ci/official/containers/linux_arm64/devel.usertools/wheel_verification.bats @@ -71,9 +71,3 @@ teardown_file() { source /tf/venv/bin/activate python3 -c 'import sys; import tensorflow as tf; sys.exit(0 if "keras" in tf.keras.__name__ else 1)' } - -# Is this still useful? -@test "TensorFlow has Estimator" { - source /tf/venv/bin/activate - python3 -c 'import sys; import tensorflow as tf; sys.exit(0 if "_v2.estimator" in tf.estimator.__name__ else 1)' -} diff --git a/ci/official/requirements_updater/BUILD.bazel b/ci/official/requirements_updater/BUILD.bazel index d03ec1a82de..8cdb70597f0 100644 --- a/ci/official/requirements_updater/BUILD.bazel +++ b/ci/official/requirements_updater/BUILD.bazel @@ -53,7 +53,6 @@ compile_pip_requirements_3_9( "--allow-unsafe", "-P keras-nightly", "-P tb-nightly", - "-P tf-estimator-nightly", ], requirements_in = "requirements.in", requirements_txt = "requirements_lock_3_9.txt", @@ -65,7 +64,6 @@ compile_pip_requirements_3_10( "--allow-unsafe", "-P keras-nightly", "-P tb-nightly", - "-P tf-estimator-nightly", ], requirements_in = "requirements.in", requirements_txt = "requirements_lock_3_10.txt", @@ -77,7 +75,6 @@ compile_pip_requirements_3_11( "--allow-unsafe", "-P keras-nightly", "-P tb-nightly", - "-P tf-estimator-nightly", ], requirements_in = "requirements.in", requirements_txt = "requirements_lock_3_11.txt", @@ -89,7 +86,6 @@ compile_pip_requirements_3_12( "--allow-unsafe", "-P keras-nightly", "-P tb-nightly", - "-P tf-estimator-nightly", ], requirements_in = "requirements.in", requirements_txt = "requirements_lock_3_12.txt", diff --git a/ci/official/requirements_updater/README.md b/ci/official/requirements_updater/README.md index ad2e350dec8..bf2c0da6673 100644 --- a/ci/official/requirements_updater/README.md +++ b/ci/official/requirements_updater/README.md @@ -108,7 +108,6 @@ unless indicated otherwise. "--allow-unsafe", "-P keras-nightly", "-P tb-nightly", - "-P tf-estimator-nightly", ], requirements_in = "requirements.in", requirements_txt = "requirements_lock_3_11.txt", diff --git a/ci/official/requirements_updater/requirements.in b/ci/official/requirements_updater/requirements.in index 0a958af350b..46b5a532d5b 100644 --- a/ci/official/requirements_updater/requirements.in +++ b/ci/official/requirements_updater/requirements.in @@ -14,13 +14,12 @@ termcolor == 2.3.0 wrapt == 1.14.1 tblib == 2.0.0 -# Install tensorboard and estimator and keras +# Install tensorboard, and keras # Note that here we want the latest version that matches TF major.minor version # Note that we must use nightly here as these are used in nightly jobs # For release jobs, we will pin these on the release branch keras-nightly ~= 3.0.0.dev tb-nightly ~= 2.15.0.a -tf-estimator-nightly ~= 2.15.0.dev # Test dependencies grpcio >= 1.24.3, < 2.0 diff --git a/requirements_lock_3_10.txt b/requirements_lock_3_10.txt index 534c341a950..434b38d603d 100644 --- a/requirements_lock_3_10.txt +++ b/requirements_lock_3_10.txt @@ -542,9 +542,6 @@ termcolor==2.3.0 \ --hash=sha256:3afb05607b89aed0ffe25202399ee0867ad4d3cb4180d98aaf8eefa6a5f7d475 \ --hash=sha256:b5b08f68937f138fe92f6c089b99f1e2da0ae56c52b78bf7075fd95420fd9a5a # via -r requirements.in -tf-estimator-nightly==2.15.0.dev2023101608 \ - --hash=sha256:fc045b32fb1a607da93799b3da0642527195a716cac424367f3c5f4edc2ec21e - # via -r requirements.in typing-extensions==4.8.0 \ --hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \ --hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef diff --git a/requirements_lock_3_11.txt b/requirements_lock_3_11.txt index 534c341a950..434b38d603d 100644 --- a/requirements_lock_3_11.txt +++ b/requirements_lock_3_11.txt @@ -542,9 +542,6 @@ termcolor==2.3.0 \ --hash=sha256:3afb05607b89aed0ffe25202399ee0867ad4d3cb4180d98aaf8eefa6a5f7d475 \ --hash=sha256:b5b08f68937f138fe92f6c089b99f1e2da0ae56c52b78bf7075fd95420fd9a5a # via -r requirements.in -tf-estimator-nightly==2.15.0.dev2023101608 \ - --hash=sha256:fc045b32fb1a607da93799b3da0642527195a716cac424367f3c5f4edc2ec21e - # via -r requirements.in typing-extensions==4.8.0 \ --hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \ --hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef diff --git a/requirements_lock_3_12.txt b/requirements_lock_3_12.txt index e22b3e7e23d..4697b1849dc 100644 --- a/requirements_lock_3_12.txt +++ b/requirements_lock_3_12.txt @@ -546,9 +546,6 @@ termcolor==2.3.0 \ --hash=sha256:3afb05607b89aed0ffe25202399ee0867ad4d3cb4180d98aaf8eefa6a5f7d475 \ --hash=sha256:b5b08f68937f138fe92f6c089b99f1e2da0ae56c52b78bf7075fd95420fd9a5a # via -r requirements.in -tf-estimator-nightly==2.15.0.dev2023101608 \ - --hash=sha256:fc045b32fb1a607da93799b3da0642527195a716cac424367f3c5f4edc2ec21e - # via -r requirements.in typing-extensions==4.8.0 \ --hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \ --hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef diff --git a/requirements_lock_3_9.txt b/requirements_lock_3_9.txt index 7fe16f96676..0fb35480a8f 100644 --- a/requirements_lock_3_9.txt +++ b/requirements_lock_3_9.txt @@ -546,9 +546,6 @@ termcolor==2.3.0 \ --hash=sha256:3afb05607b89aed0ffe25202399ee0867ad4d3cb4180d98aaf8eefa6a5f7d475 \ --hash=sha256:b5b08f68937f138fe92f6c089b99f1e2da0ae56c52b78bf7075fd95420fd9a5a # via -r requirements.in -tf-estimator-nightly==2.15.0.dev2023101608 \ - --hash=sha256:fc045b32fb1a607da93799b3da0642527195a716cac424367f3c5f4edc2ec21e - # via -r requirements.in typing-extensions==4.8.0 \ --hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \ --hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef diff --git a/tensorflow/BUILD b/tensorflow/BUILD index 6388108b677..acc8468d616 100644 --- a/tensorflow/BUILD +++ b/tensorflow/BUILD @@ -2,7 +2,6 @@ # TensorFlow is a computational framework, primarily for use in machine # learning applications. -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@bazel_skylib//lib:selects.bzl", "selects") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "bool_setting") load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda") @@ -39,6 +38,7 @@ load( "//third_party/mkl:build_defs.bzl", "if_mkl_ml", ) +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") # copybara:uncomment_begin # # buildifier: disable=out-of-order-load @@ -1710,7 +1710,6 @@ py_library( "//tensorflow/lite/python:analyzer", "//tensorflow/lite/python:lite", "//tensorflow/lite/python/authoring", - "//tensorflow/python/estimator:estimator_py", ], ) diff --git a/tensorflow/api_template.__init__.py b/tensorflow/api_template.__init__.py index 1ccf2fe07f0..a0f88926b5e 100644 --- a/tensorflow/api_template.__init__.py +++ b/tensorflow/api_template.__init__.py @@ -33,10 +33,8 @@ import inspect as _inspect import os as _os import site as _site import sys as _sys -import typing as _typing from tensorflow.python.tools import module_util as _module_util -from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader from tensorflow.python.util.lazy_loader import KerasLazyLoader as _KerasLazyLoader # Make sure code inside the TensorFlow codebase can use tf2.enabled() at import. @@ -67,14 +65,6 @@ if (_os.getenv("TF_USE_MODULAR_FILESYSTEM", "0") == "true" or _os.getenv("TF_USE_MODULAR_FILESYSTEM", "0") == "1"): import tensorflow_io_gcs_filesystem as _tensorflow_io_gcs_filesystem -# Lazy-load estimator. -_estimator_module = "tensorflow_estimator.python.estimator.api._v2.estimator" -estimator = _LazyLoader("estimator", globals(), _estimator_module) -_module_dir = _module_util.get_parent_dir_for_name(_estimator_module) -if _module_dir: - _current_module.__path__ = [_module_dir] + _current_module.__path__ -setattr(_current_module, "estimator", estimator) - # Lazy-load Keras v2/3. _tf_uses_legacy_keras = ( _os.environ.get("TF_USE_LEGACY_KERAS", None) in ("true", "True", "1")) @@ -169,18 +159,11 @@ except (ImportError, AttributeError): del importlib -# Explicitly import lazy-loaded modules to support autocompletion. -if _typing.TYPE_CHECKING: - from tensorflow_estimator.python.estimator.api._v2 import estimator as estimator - -# pylint: enable=undefined-variable - # Delete modules that should be hidden from dir(). # Don't fail if these modules are not available. # For e.g. this file will be originally placed under tensorflow/_api/v1 which # does not have "python", "core" directories. Then, it will be copied # to tensorflow/ which does have these two directories. -# pylint: disable=undefined-variable try: del python except NameError: diff --git a/tensorflow/api_template_v1.__init__.py b/tensorflow/api_template_v1.__init__.py index d15f442593f..6a4ab4e655f 100644 --- a/tensorflow/api_template_v1.__init__.py +++ b/tensorflow/api_template_v1.__init__.py @@ -20,7 +20,6 @@ import inspect as _inspect import os as _os import site as _site import sys as _sys -import typing as _typing # pylint: disable=g-bad-import-order,protected-access,g-import-not-at-top from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import @@ -70,14 +69,6 @@ if (_os.getenv("TF_USE_MODULAR_FILESYSTEM", "0") == "true" or _os.getenv("TF_USE_MODULAR_FILESYSTEM", "0") == "1"): import tensorflow_io_gcs_filesystem as _tensorflow_io_gcs_filesystem -# Lazy-load estimator. -_estimator_module = "tensorflow_estimator.python.estimator.api._v1.estimator" -estimator = _LazyLoader("estimator", globals(), _estimator_module) -_module_dir = _module_util.get_parent_dir_for_name(_estimator_module) -if _module_dir: - _current_module.__path__ = [_module_dir] + _current_module.__path__ -setattr(_current_module, "estimator", estimator) - # Lazy-load Keras v1. _tf_uses_legacy_keras = ( _os.environ.get("TF_USE_LEGACY_KERAS", None) in ("true", "True", "1")) @@ -190,17 +181,12 @@ if _os.getenv("TF_PLUGGABLE_DEVICE_LIBRARY_PATH", ""): _os.getenv("TF_PLUGGABLE_DEVICE_LIBRARY_PATH") ) -# Explicitly import lazy-loaded modules to support autocompletion. -if _typing.TYPE_CHECKING: - from tensorflow_estimator.python.estimator.api._v1 import estimator as estimator - # Delete modules that should be hidden from dir(). # Don't fail if these modules are not available. # For e.g. this file will be originally placed under tensorflow/_api/v1 which # does not have "python", "core" directories. Then, it will be copied # to tensorflow/ which does have these two directories. -# pylint: disable=undefined-variable try: del python except NameError: diff --git a/tensorflow/compat_template.__init__.py b/tensorflow/compat_template.__init__.py index 701623c3280..a5d1b306b71 100644 --- a/tensorflow/compat_template.__init__.py +++ b/tensorflow/compat_template.__init__.py @@ -18,10 +18,8 @@ import os as _os import sys as _sys -import typing as _typing from tensorflow.python.tools import module_util as _module_util -from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader from tensorflow.python.util.lazy_loader import KerasLazyLoader as _KerasLazyLoader # API IMPORTS PLACEHOLDER @@ -31,14 +29,6 @@ from tensorflow.python.util.lazy_loader import KerasLazyLoader as _KerasLazyLoad # Hook external TensorFlow modules. _current_module = _sys.modules[__name__] -# Lazy-load estimator. -_estimator_module = "tensorflow_estimator.python.estimator.api._v2.estimator" -estimator = _LazyLoader("estimator", globals(), _estimator_module) -_module_dir = _module_util.get_parent_dir_for_name(_estimator_module) -if _module_dir: - _current_module.__path__ = [_module_dir] + _current_module.__path__ -setattr(_current_module, "estimator", estimator) - # Lazy load Keras v2 _tf_uses_legacy_keras = ( _os.environ.get("TF_USE_LEGACY_KERAS", None) in ("true", "True", "1")) @@ -72,9 +62,3 @@ setattr(_current_module, "losses", _losses) setattr(_current_module, "metrics", _metrics) setattr(_current_module, "optimizers", _optimizers) setattr(_current_module, "initializers", _initializers) - -# Explicitly import lazy-loaded modules to support autocompletion. -# pylint: disable=g-import-not-at-top -if _typing.TYPE_CHECKING: - from tensorflow_estimator.python.estimator.api._v2 import estimator as estimator -# pylint: enable=g-import-not-at-top diff --git a/tensorflow/compat_template_v1.__init__.py b/tensorflow/compat_template_v1.__init__.py index e71d88c21b0..3efa4e26de6 100644 --- a/tensorflow/compat_template_v1.__init__.py +++ b/tensorflow/compat_template_v1.__init__.py @@ -18,10 +18,8 @@ import os as _os import sys as _sys -import typing as _typing from tensorflow.python.tools import module_util as _module_util -from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader from tensorflow.python.util.lazy_loader import KerasLazyLoader as _KerasLazyLoader # API IMPORTS PLACEHOLDER @@ -31,14 +29,6 @@ from tensorflow.python.util.lazy_loader import KerasLazyLoader as _KerasLazyLoad # Hook external TensorFlow modules. _current_module = _sys.modules[__name__] -# Lazy-load estimator. -_estimator_module = "tensorflow_estimator.python.estimator.api._v1.estimator" -estimator = _LazyLoader("estimator", globals(), _estimator_module) -_module_dir = _module_util.get_parent_dir_for_name(_estimator_module) -if _module_dir: - _current_module.__path__ = [_module_dir] + _current_module.__path__ -setattr(_current_module, "estimator", estimator) - # Lazy load Keras v1 _tf_uses_legacy_keras = ( _os.environ.get("TF_USE_LEGACY_KERAS", None) in ("true", "True", "1")) @@ -81,9 +71,3 @@ else: _module_dir = _module_util.get_parent_dir_for_name( "keras.api._v1.keras.__internal__.legacy.rnn_cell") _current_module.nn.__path__ = [_module_dir] + _current_module.nn.__path__ - -# Explicitly import lazy-loaded modules to support autocompletion. -# pylint: disable=g-import-not-at-top -if _typing.TYPE_CHECKING: - from tensorflow_estimator.python.estimator.api._v1 import estimator as estimator -# pylint: enable=g-import-not-at-top diff --git a/tensorflow/lite/g3doc/r1/convert/index.md b/tensorflow/lite/g3doc/r1/convert/index.md index 1cfea5ec198..f65029c22d7 100644 --- a/tensorflow/lite/g3doc/r1/convert/index.md +++ b/tensorflow/lite/g3doc/r1/convert/index.md @@ -33,7 +33,7 @@ FlatBuffers is an order of magnitude smaller than protocol buffers. The converter supports the following input formats: -* [SavedModels](https://www.tensorflow.org/guide/saved_model#using_savedmodel_with_estimators) +* [SavedModels](https://www.tensorflow.org/guide/saved_model) * `tf.keras` H5 models. * Frozen `GraphDef` models generated using [freeze_graph.py](https://www.tensorflow.org/code/tensorflow/python/tools/freeze_graph.py). diff --git a/tensorflow/lite/python/BUILD b/tensorflow/lite/python/BUILD index 1547947dc80..7dd04a58e68 100644 --- a/tensorflow/lite/python/BUILD +++ b/tensorflow/lite/python/BUILD @@ -9,7 +9,6 @@ package( default_visibility = [ "//tensorflow:__subpackages__", "//tensorflow:internal", - "//tensorflow_estimator:__subpackages__", "//third_party/py/tensorflow_federated:__subpackages__", "//third_party/tflite_micro:__subpackages__", ], diff --git a/tensorflow/lite/python/lite.py b/tensorflow/lite/python/lite.py index 1430d3bc733..22088fa71e1 100644 --- a/tensorflow/lite/python/lite.py +++ b/tensorflow/lite/python/lite.py @@ -2082,8 +2082,6 @@ class TFLiteConverterV2(TFLiteFrozenGraphConverterV2): saved_model_dir, signature_key=signature_key, tag_set=tags ) - # Ensures any graphs created in Eager mode are able to run. This is required - # in order to create a tf.estimator.Exporter that exports a TFLite model. if tags is None: tags = set([_tag_constants.SERVING]) diff --git a/tensorflow/lite/toco/README.md b/tensorflow/lite/toco/README.md index 28244712a2b..962de012f44 100644 --- a/tensorflow/lite/toco/README.md +++ b/tensorflow/lite/toco/README.md @@ -17,8 +17,8 @@ Usage information is given in these documents: Once an application developer has a trained TensorFlow model, the TensorFlow Lite Converter will accept that model and generate a TensorFlow Lite -[FlatBuffer](https://google.github.io/flatbuffers/) file. The converter currently supports -[SavedModels](https://www.tensorflow.org/guide/saved_model#using_savedmodel_with_estimators), +[FlatBuffer](https://google.github.io/flatbuffers/) file. The converter +currently supports [SavedModels](https://www.tensorflow.org/guide/saved_model), frozen graphs (models generated via [freeze_graph.py](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tools/freeze_graph.py)), and `tf.Keras` model files. The TensorFlow Lite FlatBuffer file can be shipped diff --git a/tensorflow/lite/tutorials/BUILD b/tensorflow/lite/tutorials/BUILD index 77c275d7465..2ca57c84dd1 100644 --- a/tensorflow/lite/tutorials/BUILD +++ b/tensorflow/lite/tutorials/BUILD @@ -1,5 +1,3 @@ -# Example Estimator model - load("//tensorflow:strict.default.bzl", "py_strict_binary", "py_strict_library") package( diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD index 427bb8fefb8..69030356583 100644 --- a/tensorflow/python/BUILD +++ b/tensorflow/python/BUILD @@ -79,7 +79,6 @@ py_strict_library( ], deps = [ ":no_contrib", - "//tensorflow/python/estimator:estimator_py", "//tensorflow/python/ops:gradient_checker_v2", "//tensorflow/python/ops:stateful_random_ops", "//tensorflow/python/ops/structured:structured_ops", @@ -98,13 +97,11 @@ py_strict_library( visibility = [ "//tensorflow:__pkg__", "//tensorflow:internal", - "//tensorflow/python/estimator:__subpackages__", "//tensorflow/python/keras:__subpackages__", "//tensorflow/python/tools:__pkg__", "//tensorflow/python/tools/api/generator:__pkg__", "//tensorflow/tools/api/tests:__pkg__", "//tensorflow/tools/compatibility/update:__pkg__", - "//tensorflow_estimator:__subpackages__", "//third_party/py/tensorflow_privacy:__subpackages__", # TODO(b/163395075): remove when fixed ], deps = [ @@ -121,7 +118,6 @@ py_strict_library( srcs_version = "PY3", visibility = [ "//tensorflow:__pkg__", - "//tensorflow/python/estimator:__subpackages__", "//tensorflow/python/keras:__subpackages__", "//tensorflow/python/tools:__pkg__", "//tensorflow/python/tools/api/generator:__pkg__", @@ -157,7 +153,6 @@ py_strict_library( "//tensorflow/python/distribute", "//tensorflow/python/distribute:combinations", # For tf.__internal__ API. "//tensorflow/python/distribute:distribute_config", - "//tensorflow/python/distribute:estimator_training", "//tensorflow/python/distribute:strategy_combinations", # For tf.__internal__, "//tensorflow/python/distribute/experimental/rpc:rpc_ops", "//tensorflow/python/dlpack", diff --git a/tensorflow/python/compiler/tensorrt/BUILD b/tensorflow/python/compiler/tensorrt/BUILD index 0dc49c5a56f..708f55abbc8 100644 --- a/tensorflow/python/compiler/tensorrt/BUILD +++ b/tensorflow/python/compiler/tensorrt/BUILD @@ -171,62 +171,3 @@ cuda_py_strict_test( "@absl_py//absl/testing:parameterized", ], ) - -cuda_py_strict_test( - name = "quantization_mnist_test", - srcs = ["//tensorflow/python/compiler/tensorrt/test:quantization_mnist_test_srcs"], - data = [ - "//tensorflow/python/compiler/tensorrt/test:quantization_mnist_test_data", - ], - python_version = "PY3", - tags = [ - "no_cuda_on_cpu_tap", - "no_oss", # TODO(b/125290478): allow running in at least some OSS configurations. - "no_pip", - "no_rocm", - "no_windows", - "nomac", - "notap", #TODO(b/290051231) - "requires-net:external", - ], - xla_enable_strict_auto_jit = False, - deps = [ - ":tf_trt_integration_test_base", - ":trt_convert_py", - "//tensorflow/compiler/tf2tensorrt:_pywrap_py_utils", - "//tensorflow/core:protos_all_py", - "//tensorflow/python/client:session", - "//tensorflow/python/data/ops:dataset_ops", - "//tensorflow/python/estimator", - "//tensorflow/python/estimator:model_fn", - "//tensorflow/python/estimator:run_config", - "//tensorflow/python/framework:convert_to_constants", - "//tensorflow/python/framework:dtypes", - "//tensorflow/python/framework:importer", - "//tensorflow/python/framework:ops", - "//tensorflow/python/framework:test_lib", - "//tensorflow/python/keras:metrics", - "//tensorflow/python/layers", - "//tensorflow/python/ops:array_ops", - "//tensorflow/python/ops:array_ops_gen", - "//tensorflow/python/ops:init_ops", - "//tensorflow/python/ops:math_ops", - "//tensorflow/python/ops:metrics", - "//tensorflow/python/ops:nn", - "//tensorflow/python/ops:variable_scope", - "//tensorflow/python/ops/losses", - "//tensorflow/python/platform:client_testlib", - "//tensorflow/python/platform:tf_logging", - "//tensorflow/python/saved_model:builder", - "//tensorflow/python/saved_model:load", - "//tensorflow/python/saved_model:signature_constants", - "//tensorflow/python/saved_model:signature_def_utils", - "//tensorflow/python/saved_model:tag_constants", - "//tensorflow/python/saved_model:utils", - "//tensorflow/python/summary:summary_py", - "//tensorflow/python/training:adam", - "//tensorflow/python/training:checkpoint_management", - "//tensorflow/python/training:saver", - "//tensorflow/python/training:training_util", - ], -) diff --git a/tensorflow/python/compiler/tensorrt/test/BUILD b/tensorflow/python/compiler/tensorrt/test/BUILD index 15499cbdf79..b99bcab6abe 100644 --- a/tensorflow/python/compiler/tensorrt/test/BUILD +++ b/tensorflow/python/compiler/tensorrt/test/BUILD @@ -73,22 +73,6 @@ filegroup( visibility = ["//tensorflow/python/compiler/tensorrt:__pkg__"], ) -filegroup( - name = "quantization_mnist_test_srcs", - srcs = ["quantization_mnist_test.py"], - visibility = ["//tensorflow/python/compiler/tensorrt:__pkg__"], -) - -filegroup( - name = "quantization_mnist_test_data", - srcs = [ - "testdata/mnist/checkpoint", - "testdata/mnist/model.ckpt-46900.data-00000-of-00001", - "testdata/mnist/model.ckpt-46900.index", - ], - visibility = ["//tensorflow/python/compiler/tensorrt:__pkg__"], -) - base_tags = [ "no_cuda_on_cpu_tap", "no_rocm", diff --git a/tensorflow/python/compiler/tensorrt/test/quantization_mnist_test.py b/tensorflow/python/compiler/tensorrt/test/quantization_mnist_test.py deleted file mode 100644 index 2f0ded4098b..00000000000 --- a/tensorflow/python/compiler/tensorrt/test/quantization_mnist_test.py +++ /dev/null @@ -1,411 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""Script to test TF-TRT INT8 conversion without calibration on Mnist model.""" - -import os.path -import tempfile -import tensorflow_datasets as tfds -from tensorflow.compiler.tf2tensorrt._pywrap_py_utils import is_tensorrt_enabled -from tensorflow.core.protobuf import config_pb2 -from tensorflow.python.client import session -from tensorflow.python.compiler.tensorrt import trt_convert -from tensorflow.python.data.ops import dataset_ops -from tensorflow.python.estimator.estimator import Estimator -from tensorflow.python.estimator.model_fn import EstimatorSpec -from tensorflow.python.estimator.model_fn import ModeKeys -from tensorflow.python.estimator.run_config import RunConfig -from tensorflow.python.framework import convert_to_constants -from tensorflow.python.framework import dtypes -from tensorflow.python.framework import importer -from tensorflow.python.framework import ops -from tensorflow.python.framework import test_util -from tensorflow.python.keras.metrics import Accuracy -from tensorflow.python.layers import layers -from tensorflow.python.ops import array_ops -from tensorflow.python.ops import gen_array_ops -from tensorflow.python.ops import init_ops -from tensorflow.python.ops import math_ops -from tensorflow.python.ops import metrics -from tensorflow.python.ops import nn -from tensorflow.python.ops import variable_scope -from tensorflow.python.ops.losses import losses -from tensorflow.python.platform import test -from tensorflow.python.platform import tf_logging as logging -from tensorflow.python.saved_model import builder -from tensorflow.python.saved_model import signature_constants -from tensorflow.python.saved_model import tag_constants -from tensorflow.python.saved_model import utils as saved_model_utils -from tensorflow.python.saved_model import signature_def_utils -from tensorflow.python.saved_model.load import load as saved_model_load -from tensorflow.python.summary import summary -from tensorflow.python.training import saver -from tensorflow.python.training.adam import AdamOptimizer -from tensorflow.python.training.checkpoint_management import latest_checkpoint -from tensorflow.python.training.training_util import get_global_step - -INPUT_NODE_NAME = 'input' -OUTPUT_NODE_NAME = 'output' -MNIST_TEST_DIR_PATH = 'python/compiler/tensorrt/test/testdata/mnist' - - -def _PreprocessFn(entry): - """Normalizes the pixel values to lay within the [-1, 1] range. - - The same normalization shall be used during training and inference. - """ - x, y = entry['image'], entry['label'] - x = math_ops.cast(x, dtypes.float32) - x = 2.0 * (x / 255.0) - 1.0 - y = math_ops.cast(y, dtypes.int32) - return x, y - - -def _GetDataSet(batch_size): - dataset = tfds.load('mnist', split='test') - dataset = dataset.map( - map_func=_PreprocessFn, num_parallel_calls=8).batch(batch_size=batch_size) - dataset = dataset.repeat(count=1) - return dataset - - -class QuantizationAwareTrainingMNISTTest(test_util.TensorFlowTestCase): - """Testing usage of quantization ranges inserted in graph.""" - - def _BuildGraph(self, x): - - def _Quantize(x, r): - x = gen_array_ops.quantize_and_dequantize_v2(x, -r, r) - return x - - def _DenseLayer(x, num_inputs, num_outputs, quantization_range, name): - """Defines a dense layer with quantized outputs. - - Args: - x: input to the dense layer - num_inputs: number of input columns of x - num_outputs: number of output columns - quantization_range: the min/max range for quantization - name: name of the variable scope - - Returns: - The output of the layer. - """ - with variable_scope.variable_scope(name): - kernel = variable_scope.get_variable( - 'kernel', - shape=[num_inputs, num_outputs], - dtype=dtypes.float32, - initializer=init_ops.GlorotUniform()) - bias = variable_scope.get_variable( - 'bias', - shape=[num_outputs], - dtype=dtypes.float32, - initializer=init_ops.Zeros()) - x = math_ops.matmul(x, kernel) - x = _Quantize(x, quantization_range) - x = nn.bias_add(x, bias) - x = _Quantize(x, quantization_range) - return x - - x = _Quantize(x, 1) - # Conv + Bias + Relu6 - x = layers.conv2d(x, filters=32, kernel_size=3, use_bias=True) - x = nn.relu6(x) - # Conv + Bias + Relu6 - x = layers.conv2d(x, filters=64, kernel_size=3, use_bias=True) - x = nn.relu6(x) - # Reduce - x = math_ops.reduce_mean(x, [1, 2]) - x = _Quantize(x, 6) - # FC1 - x = _DenseLayer(x, 64, 512, 6, name='dense') - x = nn.relu6(x) - # FC2 - x = _DenseLayer(x, 512, 10, 25, name='dense_1') - x = array_ops.identity(x, name=OUTPUT_NODE_NAME) - return x - - def _LoadWeights(self, model_dir, sess): - mnist_saver = saver.Saver() - checkpoint_file = latest_checkpoint(model_dir) - if checkpoint_file is None: - raise ValueError('latest_checkpoint returned None. check if' + - 'model_dir={} is the right directory'.format(model_dir)) - mnist_saver.restore(sess, checkpoint_file) - - def _GetGraphDef(self, use_trt, max_batch_size, model_dir): - """Gets the frozen mnist GraphDef. - - Args: - use_trt: whether use TF-TRT to convert the graph. - max_batch_size: the max batch size to apply during TF-TRT conversion. - model_dir: the model directory to load the checkpoints. - - Returns: - The frozen mnist GraphDef. - """ - graph = ops.Graph() - with self.session(graph=graph) as sess: - with graph.device('/GPU:0'): - x = array_ops.placeholder( - shape=(None, 28, 28, 1), dtype=dtypes.float32, name=INPUT_NODE_NAME) - self._BuildGraph(x) - self._LoadWeights(model_dir, sess) - # Freeze - graph_def = convert_to_constants.convert_variables_to_constants( - sess, sess.graph_def, output_node_names=[OUTPUT_NODE_NAME]) - # Convert with TF-TRT - if use_trt: - logging.info('Number of nodes before TF-TRT conversion: %d', - len(graph_def.node)) - converter = trt_convert.TrtGraphConverter( - input_graph_def=graph_def, - nodes_denylist=[OUTPUT_NODE_NAME], - max_batch_size=max_batch_size, - precision_mode='INT8', - max_workspace_size_bytes=( - trt_convert.DEFAULT_TRT_MAX_WORKSPACE_SIZE_BYTES), - minimum_segment_size=2, - use_calibration=False) - graph_def = converter.convert() - logging.info('Number of nodes after TF-TRT conversion: %d', - len(graph_def.node)) - num_engines = len( - [1 for n in graph_def.node if str(n.op) == 'TRTEngineOp']) - self.assertEqual(1, num_engines) - return graph_def - - def _Run(self, is_training, use_trt, batch_size, num_epochs, model_dir): - """Trains or evaluates the model. - - Args: - is_training: whether to train or evaluate the model. In training mode, - quantization will be simulated where the quantize_and_dequantize_v2 are - placed. - use_trt: if true, use TRT INT8 mode for evaluation, which will perform - real quantization. Otherwise use native TensorFlow which will perform - simulated quantization. Ignored if is_training is True. - batch_size: batch size. - num_epochs: how many epochs to train. Ignored if is_training is False. - model_dir: where to save or load checkpoint. - - Returns: - The Estimator evaluation result. - """ - - def _EvalInputFn(): - dataset = _GetDataSet(batch_size) - iterator = dataset_ops.make_one_shot_iterator(dataset) - features, labels = iterator.get_next() - return features, labels - - def _TrainInputFn(): - dataset = tfds.load('mnist', split='train') - dataset = dataset.shuffle(60000) - dataset = dataset.map( - map_func=_PreprocessFn, - num_parallel_calls=8).batch(batch_size=batch_size) - dataset = dataset.repeat(count=num_epochs) - iterator = dataset_ops.make_one_shot_iterator(dataset) - features, labels = iterator.get_next() - return features, labels - - def _ModelFn(features, labels, mode): - if is_training: - logits_out = self._BuildGraph(features) - else: - graph_def = self._GetGraphDef(use_trt, batch_size, model_dir) - logits_out = importer.import_graph_def( - graph_def, - input_map={INPUT_NODE_NAME: features}, - return_elements=[OUTPUT_NODE_NAME + ':0'], - name='')[0] - - loss = losses.sparse_softmax_cross_entropy( - labels=labels, logits=logits_out) - summary.scalar('loss', loss) - - classes_out = math_ops.argmax(logits_out, axis=1, name='classes_out') - accuracy = metrics.accuracy( - labels=labels, predictions=classes_out, name='acc_op') - summary.scalar('accuracy', accuracy[1]) - - if mode == ModeKeys.EVAL: - return EstimatorSpec( - mode, loss=loss, eval_metric_ops={'accuracy': accuracy}) - if mode == ModeKeys.TRAIN: - optimizer = AdamOptimizer(learning_rate=1e-2) - train_op = optimizer.minimize(loss, global_step=get_global_step()) - return EstimatorSpec(mode, loss=loss, train_op=train_op) - - config_proto = config_pb2.ConfigProto() - config_proto.gpu_options.allow_growth = True - estimator = Estimator( - model_fn=_ModelFn, - model_dir=model_dir if is_training else None, - config=RunConfig(session_config=config_proto)) - - if is_training: - estimator.train(_TrainInputFn) - results = estimator.evaluate(_EvalInputFn) - logging.info('accuracy: %s', str(results['accuracy'])) - return results - - # To generate the checkpoint, set a different model_dir and call self._Run() - # by setting is_training=True and num_epochs=1000, e.g.: - # model_dir = '/tmp/quantization_mnist' - # self._Run( - # is_training=True, - # use_trt=False, - # batch_size=128, - # num_epochs=100, - # model_dir=model_dir) - def testEval(self): - - model_dir = test.test_src_dir_path(MNIST_TEST_DIR_PATH) - - accuracy_tf_native = self._Run( - is_training=False, - use_trt=False, - batch_size=128, - num_epochs=None, - model_dir=model_dir)['accuracy'] - logging.info('accuracy_tf_native: %f', accuracy_tf_native) - self.assertAllClose(0.9662, accuracy_tf_native, rtol=3e-3, atol=3e-3) - - accuracy_tf_trt = self._Run( - is_training=False, - use_trt=True, - batch_size=128, - num_epochs=None, - model_dir=model_dir)['accuracy'] - logging.info('accuracy_tf_trt: %f', accuracy_tf_trt) - self.assertAllClose(0.9675, accuracy_tf_trt, rtol=1e-3, atol=1e-3) - - -class MNISTTestV2(QuantizationAwareTrainingMNISTTest): - - def _SaveModel(self, model_dir, output_dir): - saved_model_builder = builder.SavedModelBuilder(output_dir) - graph = ops.Graph() - with session.Session(graph=graph) as sess: - with graph.device('/GPU:0'): - x = array_ops.placeholder( - shape=(None, 28, 28, 1), dtype=dtypes.float32, name=INPUT_NODE_NAME) - self._BuildGraph(x) - self._LoadWeights(model_dir, sess) - input_tensor = graph.get_tensor_by_name(INPUT_NODE_NAME + ':0') - output = graph.get_tensor_by_name(OUTPUT_NODE_NAME + ':0') - signature_def = signature_def_utils.build_signature_def( - inputs={'input': saved_model_utils.build_tensor_info(input_tensor)}, - outputs={'output': saved_model_utils.build_tensor_info(output)}, - method_name=signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY) - saved_model_builder.add_meta_graph_and_variables( - sess, [tag_constants.SERVING], - signature_def_map={ - signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY: - signature_def - }) - saved_model_builder.save() - - def _GetFunc(self, use_trt, model_dir, use_dynamic_shape): - """Gets the mnist function. - - Args: - use_trt: whether use TF-TRT to convert the graph. - model_dir: the model directory to load the checkpoints. - use_dynamic_shape: whether to run the TF-TRT conversion in dynamic shape - mode. - - Returns: - The mnist model function. - """ - with tempfile.TemporaryDirectory() as tmpdir: - saved_model_dir = os.path.join(tmpdir, 'mnist') - self._SaveModel(model_dir, saved_model_dir) - - if use_trt: - conv_params = trt_convert.TrtConversionParams( - precision_mode='FP16', - minimum_segment_size=2, - max_workspace_size_bytes=( - trt_convert.DEFAULT_TRT_MAX_WORKSPACE_SIZE_BYTES), - maximum_cached_engines=1) - converter = trt_convert.TrtGraphConverterV2( - input_saved_model_dir=saved_model_dir, - use_dynamic_shape=use_dynamic_shape, - dynamic_shape_profile_strategy='ImplicitBatchModeCompatible', - **conv_params._asdict()) - converter.convert() - try: - line_length = max(160, os.get_terminal_size().columns) - except OSError: - line_length = 160 - converter.summary(line_length=line_length, detailed=True) - func = converter._converted_func - else: - saved_model_loaded = saved_model_load( - saved_model_dir, tags=[tag_constants.SERVING]) - func = saved_model_loaded.signatures[ - signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY] - return func - - def _Run(self, use_trt, batch_size, model_dir, use_dynamic_shape=False): - """Evaluates the model. - - Args: - use_trt: if true, use TRT INT8 mode for evaluation, which will perform - real quantization. Otherwise use native TensorFlow which will perform - simulated quantization. Ignored if is_training is True. - batch_size: batch size. - model_dir: where to save or load checkpoint. - use_dynamic_shape: if true, then TF-TRT dynamic shape mode is enabled, - otherwise disabled. Ignored if use_trt is false. - - Returns: - The Estimator evaluation result. - """ - func = self._GetFunc(use_trt, model_dir, use_dynamic_shape) - ds = _GetDataSet(batch_size) - - m = Accuracy() - for example in ds: - image, label = example[0], example[1] - pred = func(image) - m.update_state(math_ops.argmax(pred['output'], axis=1), label) - - return m.result().numpy() - - def testEval(self): - model_dir = test.test_src_dir_path(MNIST_TEST_DIR_PATH) - - accuracy_tf_trt = self._Run( - use_trt=True, - batch_size=128, - use_dynamic_shape=False, - model_dir=model_dir) - logging.info('accuracy_tf_trt: %f', accuracy_tf_trt) - self.assertAllClose(0.9675, accuracy_tf_trt, rtol=1e-3, atol=1e-3) - - accuracy_tf_trt = self._Run( - use_trt=True, - batch_size=128, - use_dynamic_shape=True, - model_dir=model_dir) - logging.info('accuracy_tf_trt: %f', accuracy_tf_trt) - self.assertAllClose(0.9675, accuracy_tf_trt, rtol=1e-3, atol=1e-3) - -if __name__ == '__main__' and is_tensorrt_enabled(): - test.main() diff --git a/tensorflow/python/compiler/xla/BUILD b/tensorflow/python/compiler/xla/BUILD index c36540a77a0..aaefc6939c4 100644 --- a/tensorflow/python/compiler/xla/BUILD +++ b/tensorflow/python/compiler/xla/BUILD @@ -87,7 +87,6 @@ cuda_py_strict_test( deps = [ ":xla", "//tensorflow/python/eager:def_function", - "//tensorflow/python/estimator:model_fn", "//tensorflow/python/framework:constant_op", "//tensorflow/python/framework:ops", "//tensorflow/python/framework:test_lib", @@ -99,7 +98,7 @@ cuda_py_strict_test( "//tensorflow/python/ops:variable_scope", "//tensorflow/python/ops:while_loop", "//tensorflow/python/platform:client_testlib", - "//tensorflow/python/summary:__init__", + "//tensorflow/python/summary:summary_py", "//tensorflow/python/tpu:tpu_feed", "@absl_py//absl/testing:parameterized", ], diff --git a/tensorflow/python/compiler/xla/tests/xla_test.py b/tensorflow/python/compiler/xla/tests/xla_test.py index 86e1a1703ec..8e839bb292e 100644 --- a/tensorflow/python/compiler/xla/tests/xla_test.py +++ b/tensorflow/python/compiler/xla/tests/xla_test.py @@ -16,10 +16,8 @@ from absl.testing import parameterized -from tensorflow.python import summary from tensorflow.python.compiler.xla import xla from tensorflow.python.eager import def_function -from tensorflow.python.estimator import model_fn as model_fn_lib from tensorflow.python.framework import constant_op from tensorflow.python.framework import ops from tensorflow.python.framework import test_util @@ -31,11 +29,10 @@ from tensorflow.python.ops import state_ops from tensorflow.python.ops import variable_scope from tensorflow.python.ops import while_loop from tensorflow.python.platform import test +from tensorflow.python.summary import summary from tensorflow.python.tpu import tpu_feed -_TRAIN = model_fn_lib.ModeKeys.TRAIN -_EVAL = model_fn_lib.ModeKeys.EVAL _EXPECTED_LOSS = 1 _EXPECTED_FEATURE = 2 _EXPECTED_LABEL = 3 diff --git a/tensorflow/python/compiler/xla/xla.py b/tensorflow/python/compiler/xla/xla.py index 6d2312dfd05..a290ef8228d 100644 --- a/tensorflow/python/compiler/xla/xla.py +++ b/tensorflow/python/compiler/xla/xla.py @@ -572,21 +572,6 @@ class _CapturedObject(object): return self._object -def _get_scaffold(captured_scaffold_fn): - """Retrieves the Scaffold from `captured_scaffold_fn`.""" - scaffold_fn = captured_scaffold_fn.get() - - if not scaffold_fn: - return None - - scaffold = scaffold_fn() - if scaffold is None: - raise ValueError( - 'TPUEstimatorSpec.scaffold_fn returns None, which is not allowed') - - return scaffold - - def check_function_argument_count(func, input_arity, infeed_queue): """Validate the number of input arguments to an XLA function. diff --git a/tensorflow/python/data/experimental/__init__.py b/tensorflow/python/data/experimental/__init__.py index 3965ab53b77..eaaca860a31 100644 --- a/tensorflow/python/data/experimental/__init__.py +++ b/tensorflow/python/data/experimental/__init__.py @@ -25,7 +25,6 @@ See [Importing Data](https://tensorflow.org/guide/datasets) for an overview. @@AutoShardPolicy @@AutotuneAlgorithm @@AutotuneOptions -@@CheckpointInputPipelineHook @@Counter @@CsvDataset @@DatasetInitializer @@ -120,7 +119,6 @@ from tensorflow.python.data.experimental.ops.interleave_ops import parallel_inte from tensorflow.python.data.experimental.ops.interleave_ops import sample_from_datasets from tensorflow.python.data.experimental.ops.io import load from tensorflow.python.data.experimental.ops.io import save -from tensorflow.python.data.experimental.ops.iterator_ops import CheckpointInputPipelineHook from tensorflow.python.data.experimental.ops.iterator_ops import make_saveable_from_iterator from tensorflow.python.data.experimental.ops.lookup_ops import DatasetInitializer from tensorflow.python.data.experimental.ops.lookup_ops import index_table_from_dataset diff --git a/tensorflow/python/data/experimental/kernel_tests/BUILD b/tensorflow/python/data/experimental/kernel_tests/BUILD index 45667a43b71..47f44a8e315 100644 --- a/tensorflow/python/data/experimental/kernel_tests/BUILD +++ b/tensorflow/python/data/experimental/kernel_tests/BUILD @@ -85,30 +85,6 @@ tf_py_strict_test( ], ) -tf_py_strict_test( - name = "checkpoint_input_pipeline_hook_test", - size = "medium", - srcs = ["checkpoint_input_pipeline_hook_test.py"], - tags = ["no_windows"], # b/287333711 - deps = [ - "//tensorflow/python/checkpoint:checkpoint_management", - "//tensorflow/python/data/experimental/ops:iterator_ops", - "//tensorflow/python/data/kernel_tests:test_base", - "//tensorflow/python/data/ops:dataset_ops", - "//tensorflow/python/estimator:estimator_py", - "//tensorflow/python/framework:combinations", - "//tensorflow/python/framework:constant_op", - "//tensorflow/python/framework:dtypes", - "//tensorflow/python/framework:ops", - "//tensorflow/python/ops:control_flow_ops", - "//tensorflow/python/ops:variable_v1", - "//tensorflow/python/platform:client_testlib", - "//tensorflow/python/training:saver", - "//tensorflow/python/training:training_util", - "@absl_py//absl/testing:parameterized", - ], -) - tf_py_strict_test( name = "compression_ops_test", size = "small", diff --git a/tensorflow/python/data/experimental/kernel_tests/checkpoint_input_pipeline_hook_test.py b/tensorflow/python/data/experimental/kernel_tests/checkpoint_input_pipeline_hook_test.py deleted file mode 100644 index 036f7fa51dd..00000000000 --- a/tensorflow/python/data/experimental/kernel_tests/checkpoint_input_pipeline_hook_test.py +++ /dev/null @@ -1,127 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""Tests for experimental iterator_ops.""" - -from absl.testing import parameterized -from tensorflow.python.checkpoint import checkpoint_management -from tensorflow.python.data.experimental.ops import iterator_ops -from tensorflow.python.data.kernel_tests import test_base -from tensorflow.python.data.ops import dataset_ops -from tensorflow.python.estimator import estimator_lib -from tensorflow.python.framework import combinations -from tensorflow.python.framework import constant_op -from tensorflow.python.framework import dtypes -from tensorflow.python.framework import ops -from tensorflow.python.ops import control_flow_ops -from tensorflow.python.ops import variable_v1 -from tensorflow.python.platform import test -from tensorflow.python.training import saver as saver_lib -from tensorflow.python.training import training_util - - -# TODO(b/123904664) -class CheckpointInputPipelineHookTest(test.TestCase, parameterized.TestCase): - - @staticmethod - def _model_fn(features, labels, mode, config): - del labels - del mode - del config - global_step = training_util.get_or_create_global_step() - update_global_step_op = global_step.assign_add(1) - latest_feature = variable_v1.VariableV1( - 0, name='latest_feature', dtype=dtypes.int64) - store_latest_feature_op = latest_feature.assign(features) - ops.add_to_collection('my_vars', global_step) - ops.add_to_collection('my_vars', latest_feature) - return estimator_lib.EstimatorSpec( - mode='train', - train_op=control_flow_ops.group( - [update_global_step_op, store_latest_feature_op]), - loss=constant_op.constant(2.0)) - - def _read_vars(self, model_dir): - """Returns (global_step, latest_feature).""" - with ops.Graph().as_default() as g: - ckpt_path = checkpoint_management.latest_checkpoint(model_dir) - meta_filename = ckpt_path + '.meta' - saver_lib.import_meta_graph(meta_filename) - saver = saver_lib.Saver() - with self.session(graph=g) as sess: - saver.restore(sess, ckpt_path) - return sess.run(ops.get_collection('my_vars')) - - def _build_iterator_saver_hook(self, est): - return iterator_ops.CheckpointInputPipelineHook(est) - - @combinations.generate(test_base.v1_only_combinations()) - def testReturnDatasetFromInputFn(self): - - def _input_fn(): - return dataset_ops.Dataset.range(10) - - est = estimator_lib.Estimator(model_fn=self._model_fn) - - est.train(_input_fn, steps=2, hooks=[self._build_iterator_saver_hook(est)]) - self.assertSequenceEqual(self._read_vars(est.model_dir), (2, 1)) - est.train(_input_fn, steps=2, hooks=[self._build_iterator_saver_hook(est)]) - self.assertSequenceEqual(self._read_vars(est.model_dir), (4, 3)) - - @combinations.generate(test_base.v1_only_combinations()) - def testBuildIteratorInInputFn(self): - - def _input_fn(): - ds = dataset_ops.Dataset.range(10) - iterator = ds.make_one_shot_iterator() - return iterator.get_next() - - est = estimator_lib.Estimator(model_fn=self._model_fn) - - est.train(_input_fn, steps=2, hooks=[self._build_iterator_saver_hook(est)]) - self.assertSequenceEqual(self._read_vars(est.model_dir), (2, 1)) - est.train(_input_fn, steps=2, hooks=[self._build_iterator_saver_hook(est)]) - self.assertSequenceEqual(self._read_vars(est.model_dir), (4, 3)) - - @combinations.generate(test_base.v1_only_combinations()) - def testDoNotRestore(self): - - def _input_fn(): - return dataset_ops.Dataset.range(10) - - est = estimator_lib.Estimator(model_fn=self._model_fn) - - est.train(_input_fn, steps=2, hooks=[self._build_iterator_saver_hook(est)]) - self.assertSequenceEqual(self._read_vars(est.model_dir), (2, 1)) - est.train(_input_fn, steps=2, hooks=[self._build_iterator_saver_hook(est)]) - self.assertSequenceEqual(self._read_vars(est.model_dir), (4, 3)) - # Hook not provided, input pipeline was not restored. - est.train(_input_fn, steps=2) - self.assertSequenceEqual(self._read_vars(est.model_dir), (6, 1)) - - @combinations.generate(test_base.v1_only_combinations()) - def testRaiseErrorIfNoIterator(self): - - def _input_fn(): - return constant_op.constant(1, dtype=dtypes.int64) - - est = estimator_lib.Estimator(model_fn=self._model_fn) - - with self.assertRaises(ValueError): - est.train( - _input_fn, steps=2, hooks=[self._build_iterator_saver_hook(est)]) - - -if __name__ == '__main__': - test.main() diff --git a/tensorflow/python/data/experimental/ops/BUILD b/tensorflow/python/data/experimental/ops/BUILD index cc604a2afeb..75e297261a5 100644 --- a/tensorflow/python/data/experimental/ops/BUILD +++ b/tensorflow/python/data/experimental/ops/BUILD @@ -223,13 +223,8 @@ py_strict_library( ], srcs_version = "PY3", deps = [ - "//tensorflow/python/checkpoint:checkpoint_management", "//tensorflow/python/data/ops:iterator_ops", "//tensorflow/python/data/ops:options", - "//tensorflow/python/framework:ops", - "//tensorflow/python/training:basic_session_run_hooks", - "//tensorflow/python/training:saver", - "//tensorflow/python/training:session_run_hook", "//tensorflow/python/util:deprecation", "//tensorflow/python/util:tf_export", ], diff --git a/tensorflow/python/data/experimental/ops/get_single_element.py b/tensorflow/python/data/experimental/ops/get_single_element.py index 6a8d65e036b..453d51dd9eb 100644 --- a/tensorflow/python/data/experimental/ops/get_single_element.py +++ b/tensorflow/python/data/experimental/ops/get_single_element.py @@ -89,44 +89,6 @@ def get_single_element(dataset): signatures={'serving_default': preprocessing_model.serving_fn}) ``` - # Estimator - - In the case of estimators, you need to generally define a `serving_input_fn` - which would require the features to be processed by the model while - inferencing. - - ```python - def serving_input_fn(): - - raw_feature_spec = ... # Spec for the raw_features - input_fn = tf.estimator.export.build_parsing_serving_input_receiver_fn( - raw_feature_spec, default_batch_size=None) - ) - serving_input_receiver = input_fn() - raw_features = serving_input_receiver.features - - def preprocessing_fn(raw_feature): - # ... the raw_feature is preprocessed as per the use-case - return feature - - dataset = (tf.data.Dataset.from_tensor_slices(raw_features) - .map(preprocessing_fn, num_parallel_calls=BATCH_SIZE) - .batch(BATCH_SIZE)) - - processed_features = tf.data.experimental.get_single_element(dataset) - - # Please note that the value of `BATCH_SIZE` should be equal to - # the size of the leading dimension of `raw_features`. This ensures - # that `dataset` has only element, which is a pre-requisite for - # using `tf.data.experimental.get_single_element(dataset)`. - - return tf.estimator.export.ServingInputReceiver( - processed_features, serving_input_receiver.receiver_tensors) - - estimator = ... # A pre-built or custom estimator - estimator.export_saved_model(your_exported_model_dir, serving_input_fn) - ``` - Args: dataset: A `tf.data.Dataset` object containing a single element. diff --git a/tensorflow/python/data/experimental/ops/iterator_ops.py b/tensorflow/python/data/experimental/ops/iterator_ops.py index 12a8643923f..16166e002cb 100644 --- a/tensorflow/python/data/experimental/ops/iterator_ops.py +++ b/tensorflow/python/data/experimental/ops/iterator_ops.py @@ -14,13 +14,8 @@ # ============================================================================== """Iterator ops.""" -from tensorflow.python.checkpoint import checkpoint_management from tensorflow.python.data.ops import iterator_ops from tensorflow.python.data.ops import options as options_lib -from tensorflow.python.framework import ops -from tensorflow.python.training import basic_session_run_hooks -from tensorflow.python.training import saver as saver_lib -from tensorflow.python.training import session_run_hook from tensorflow.python.util import deprecation from tensorflow.python.util.tf_export import tf_export @@ -100,222 +95,3 @@ def make_saveable_from_iterator(iterator, external_state_policy=None): iterator._iterator_resource, # pylint: disable=protected-access iterator._iterator_resource.name, # pylint: disable=protected-access external_state_policy=policy_enum) - - -@tf_export("data.experimental.CheckpointInputPipelineHook") -class CheckpointInputPipelineHook(session_run_hook.SessionRunHook): - """Checkpoints input pipeline state every N steps or seconds. - - This hook saves the state of the iterators in the `Graph` so that when - training is resumed the input pipeline continues from where it left off. - This could potentially avoid overfitting in certain pipelines where the - number of training steps per eval are small compared to the dataset - size or if the training pipeline is pre-empted. - - Differences from `CheckpointSaverHook`: - 1. Saves only the input pipelines in the "iterators" collection and not the - global variables or other saveable objects. - 2. Does not write the `GraphDef` and `MetaGraphDef` to the summary. - - Example of checkpointing the training pipeline: - - ```python - est = tf.estimator.Estimator(model_fn) - while True: - est.train( - train_input_fn, - hooks=[tf.data.experimental.CheckpointInputPipelineHook(est)], - steps=train_steps_per_eval) - # Note: We do not pass the hook here. - metrics = est.evaluate(eval_input_fn) - if should_stop_the_training(metrics): - break - ``` - - This hook should be used if the input pipeline state needs to be saved - separate from the model checkpoint. Doing so may be useful for a few reasons: - 1. The input pipeline checkpoint may be large, if there are large shuffle - or prefetch buffers for instance, and may bloat the checkpoint size. - 2. If the input pipeline is shared between training and validation, restoring - the checkpoint during validation may override the validation input - pipeline. - - For saving the input pipeline checkpoint alongside the model weights use - `tf.data.experimental.make_saveable_from_iterator` directly to create a - `SaveableObject` and add to the `SAVEABLE_OBJECTS` collection. Note, however, - that you will need to be careful not to restore the training iterator during - eval. You can do that by not adding the iterator to the SAVEABLE_OBJECTS - collector when building the eval graph. - """ - - def __init__(self, estimator, external_state_policy=None): - """Initializes a `CheckpointInputPipelineHook`. - - If the input pipeline depends on external state (e.g. seeds for - RandomUniform) beyond the input pipeline, this hook would be unable to - serialize and deserialize that state. If its acceptable to ignore that state - change the external_state_policy argument to 'warn' or 'ignore'. For e.g. - - ```python - est = tf.estimator.Estimator(model_fn) - while True: - est.train( - train_input_fn, - hooks=[tf.data.experimental.CheckpointInputPipelineHook( - est, external_state_policy='warn')], - steps=train_steps_per_eval) - # Note: We do not pass the hook here. - metrics = est.evaluate(eval_input_fn) - if should_stop_the_training(metrics): - break - ``` - - Args: - estimator: Estimator. - external_state_policy: A string that identifies how to handle input - pipelines that depend on external state. Possible values are - 'ignore': The external state is silently ignored. - 'warn': The external state is ignored, logging a warning. - 'fail': The operation fails upon encountering external state. - By default we set it to 'fail'. - - Raises: - ValueError: One of `save_steps` or `save_secs` should be set. - ValueError: At most one of saver or scaffold should be set. - ValueError: If `external_state_policy` is not one of 'warn', 'ignore' or - 'fail'. - """ - if external_state_policy is None: - external_state_policy = "fail" - self._external_state_policy = _convert_external_state_policy_to_enum( - external_state_policy) - # `checkpoint_basename` is "input.ckpt" for non-distributed pipelines or - # of the form "input__.ckpt" for distributed pipelines. - # Note: The default `checkpoint_basename` used by `CheckpointSaverHook` is - # "model.ckpt". We intentionally choose the input pipeline checkpoint prefix - # to be different to avoid conflicts with the model checkpoint. - - # pylint: disable=protected-access - checkpoint_prefix = "input" - if estimator._config.num_worker_replicas > 1: - # Distributed setting. - suffix = "_{}_{}".format(estimator._config.task_type, - estimator._config.task_id) - checkpoint_prefix += suffix - # pylint: enable=protected-access - - # We use a composition paradigm instead of inheriting from - # `CheckpointSaverHook` because `Estimator` does an `isinstance` check - # to check whether a `CheckpointSaverHook` is already present in the list - # of hooks and if not, adds one. Inheriting from `CheckpointSaverHook` - # would thwart this behavior. This hook checkpoints *only the iterators* - # and not the graph variables. - self._checkpoint_saver_hook = basic_session_run_hooks.CheckpointSaverHook( - estimator.model_dir, - save_secs=estimator._config.save_checkpoints_secs, # pylint: disable=protected-access - save_steps=estimator._config.save_checkpoints_steps, # pylint: disable=protected-access - checkpoint_basename=checkpoint_prefix + ".ckpt") - - # Name for the protocol buffer file that will contain the list of most - # recent checkpoints stored as a `CheckpointState` protocol buffer. - # This file, kept in the same directory as the checkpoint files, is - # automatically managed by the `Saver` to keep track of recent checkpoints. - # The default name used by the `Saver` for this file is "checkpoint". Here - # we use the name "checkpoint_" so that in case the - # `checkpoint_dir` is the same as the model checkpoint directory, there are - # no conflicts during restore. - self._latest_filename = "checkpoint_" + checkpoint_prefix - - def begin(self): - # Build a Saver that saves all iterators in the `GLOBAL_ITERATORS` - # collection if no `Saver` or `Scaffold` is provided. - # pylint: disable=protected-access - if (self._checkpoint_saver_hook._saver is None and - self._checkpoint_saver_hook._scaffold is None): - iterators = ops.get_collection(iterator_ops.GLOBAL_ITERATORS) - saveables = [ - iterator_ops._IteratorSaveable( - i, i.name, external_state_policy=self._external_state_policy) - for i in iterators - ] - self._checkpoint_saver_hook._saver = _CustomSaver( - saveables, self._latest_filename, sharded=True) - # pylint: enable=protected-access - self._checkpoint_saver_hook.begin() - - def after_create_session(self, session, coord): - # If a new session was created, we set _first_run to True so that we can - # restore if needed. - self._first_run = True - - def _restore_or_save_initial_ckpt(self, session): - # Ideally this should be run in after_create_session but is not for the - # following reason: - # Currently there is no way of enforcing an order of running the - # `SessionRunHooks`. Hence it is possible that the `_DatasetInitializerHook` - # is run *after* this hook. That is troublesome because - # 1. If a checkpoint exists and this hook restores it, the initializer hook - # will override it. - # 2. If no checkpoint exists, this hook will try to save an uninitialized - # iterator which will result in an exception. - # - # As a temporary fix we enter the following implicit contract between this - # hook and the _DatasetInitializerHook. - # 1. The _DatasetInitializerHook initializes the iterator in the call to - # after_create_session. - # 2. This hook saves the iterator on the first call to `before_run()`, which - # is guaranteed to happen after `after_create_session()` of all hooks - # have been run. - - # Check if there is an existing checkpoint. If so, restore from it. - # pylint: disable=protected-access - latest_checkpoint_path = checkpoint_management.latest_checkpoint( - self._checkpoint_saver_hook._checkpoint_dir, - latest_filename=self._latest_filename) - if latest_checkpoint_path: - self._checkpoint_saver_hook._get_saver().restore(session, - latest_checkpoint_path) - else: - # The checkpoint saved here is the state at step "global_step". - # Note: We do not save the GraphDef or MetaGraphDef here. - global_step = session.run(self._checkpoint_saver_hook._global_step_tensor) - self._checkpoint_saver_hook._save(session, global_step) - self._checkpoint_saver_hook._timer.update_last_triggered_step(global_step) - # pylint: enable=protected-access - - def before_run(self, run_context): - if self._first_run: - self._restore_or_save_initial_ckpt(run_context.session) - self._first_run = False - return self._checkpoint_saver_hook.before_run(run_context) - - def after_run(self, run_context, run_values): - self._checkpoint_saver_hook.after_run(run_context, run_values) - - def end(self, session): - self._checkpoint_saver_hook.end(session) - - -class _CustomSaver(saver_lib.Saver): - """`Saver` with a different default `latest_filename`. - - This is used in the `CheckpointInputPipelineHook` to avoid conflicts with - the model ckpt saved by the `CheckpointSaverHook`. - """ - - def __init__(self, var_list, latest_filename, sharded=False): - super(_CustomSaver, self).__init__(var_list, sharded=sharded) - self._latest_filename = latest_filename - - def save(self, - sess, - save_path, - global_step=None, - latest_filename=None, - meta_graph_suffix="meta", - write_meta_graph=True, - write_state=True, - strip_default_attrs=False): - return super(_CustomSaver, self).save( - sess, save_path, global_step, latest_filename or self._latest_filename, - meta_graph_suffix, write_meta_graph, write_state, strip_default_attrs) diff --git a/tensorflow/python/data/experimental/ops/readers.py b/tensorflow/python/data/experimental/ops/readers.py index 75a4a9c39ff..7ffcbeb4d49 100644 --- a/tensorflow/python/data/experimental/ops/readers.py +++ b/tensorflow/python/data/experimental/ops/readers.py @@ -421,9 +421,7 @@ def make_csv_dataset_v2( index. label_name: A optional string corresponding to the label column. If provided, the data for this column is returned as a separate `Tensor` from - the features dictionary, so that the dataset complies with the format - expected by a `tf.Estimator.train` or `tf.Estimator.evaluate` input - function. + the features dictionary. select_columns: An optional list of integer indices or string column names, that specifies a subset of columns of CSV data to select. If column names are provided, these must correspond to names provided in diff --git a/tensorflow/python/data/kernel_tests/dataset_test.py b/tensorflow/python/data/kernel_tests/dataset_test.py index 30401e37448..13bcb265614 100644 --- a/tensorflow/python/data/kernel_tests/dataset_test.py +++ b/tensorflow/python/data/kernel_tests/dataset_test.py @@ -402,7 +402,7 @@ class DatasetTest(test_base.DatasetTestBase, parameterized.TestCase): dataset = dataset_ops.Dataset.range(10) with ops.Graph().as_default(): with self.assertRaisesRegex(ValueError, - "make sure that the dataset is created in " + "Make sure that the dataset is created in " "the same graph as the iterator"): _ = dataset_ops.make_one_shot_iterator(dataset) @@ -412,7 +412,7 @@ class DatasetTest(test_base.DatasetTestBase, parameterized.TestCase): dataset = dataset_ops.Dataset.range(10) with ops.Graph().as_default(): with self.assertRaisesRegex(ValueError, - "make sure that the dataset is created in " + "Make sure that the dataset is created in " "the same graph as the iterator"): _ = dataset_ops.make_initializable_iterator(dataset) diff --git a/tensorflow/python/data/ops/dataset_ops.py b/tensorflow/python/data/ops/dataset_ops.py index 927f619de90..ba17b3d12f3 100644 --- a/tensorflow/python/data/ops/dataset_ops.py +++ b/tensorflow/python/data/ops/dataset_ops.py @@ -2867,44 +2867,6 @@ name=None)) ) ``` - #### Estimator - - In the case of estimators, you need to generally define a `serving_input_fn` - which would require the features to be processed by the model while - inferencing. - - ```python - def serving_input_fn(): - - raw_feature_spec = ... # Spec for the raw_features - input_fn = tf.estimator.export.build_parsing_serving_input_receiver_fn( - raw_feature_spec, default_batch_size=None) - ) - serving_input_receiver = input_fn() - raw_features = serving_input_receiver.features - - def preprocessing_fn(raw_feature): - # ... the raw_feature is preprocessed as per the use-case - return feature - - dataset = (tf.data.Dataset.from_tensor_slices(raw_features) - .map(preprocessing_fn, num_parallel_calls=BATCH_SIZE) - .batch(BATCH_SIZE)) - - processed_features = dataset.get_single_element() - - # Please note that the value of `BATCH_SIZE` should be equal to - # the size of the leading dimension of `raw_features`. This ensures - # that `dataset` has only element, which is a pre-requisite for - # using `dataset.get_single_element()`. - - return tf.estimator.export.ServingInputReceiver( - processed_features, serving_input_receiver.receiver_tensors) - - estimator = ... # A pre-built or custom estimator - estimator.export_saved_model(your_exported_model_dir, serving_input_fn) - ``` - Args: name: (Optional.) A name for the tf.data operation. @@ -4266,10 +4228,8 @@ def _ensure_same_dataset_graph(dataset): raise ValueError( f"The graph {current_graph} of the iterator is different from the " f"graph {ds_graph} the dataset: {ds._variant_tensor} was created in. " - f"If you are using the Estimator API, make sure that no part of the " - f"dataset returned by the `input_fn` function is defined outside the " - f"`input_fn` function. Otherwise, make sure that the dataset is " - f"created in the same graph as the iterator.") + f"Make sure that the dataset is created in the same graph as the " + f"iterator.") for input_ds in ds._inputs(): if input_ds not in visited: bfs_q.put(input_ds) diff --git a/tensorflow/python/debug/examples/v1/BUILD b/tensorflow/python/debug/examples/v1/BUILD index 3daaf7872a0..1ff7a28f066 100644 --- a/tensorflow/python/debug/examples/v1/BUILD +++ b/tensorflow/python/debug/examples/v1/BUILD @@ -29,20 +29,6 @@ py_strict_binary( ], ) -py_strict_binary( - name = "debug_tflearn_iris", - srcs = ["debug_tflearn_iris.py"], - python_version = "PY3", - srcs_version = "PY3", - deps = [ - "//tensorflow:tensorflow_py", - # copybara:uncomment_begin(google-only) - # "//third_party/py/tensorflow:tensorflow_compat_v1_estimator", # build_cleaner:keep - # copybara:uncomment_end - "//tensorflow/python/debug:debug_py", - ], -) - py_strict_binary( name = "debug_keras", srcs = ["debug_keras.py"], @@ -119,19 +105,6 @@ sh_test( ], ) -sh_test( - name = "examples_v1_debug_tflearn_iris_test", - srcs = ["examples_v1_debug_tflearn_iris_test.sh"], - data = [ - ":debug_tflearn_iris", - ], - tags = [ - "no_windows", - "noasan", - "v1only", - ], -) - sh_test( name = "examples_v1_offline_analyzer_test", srcs = ["examples_v1_offline_analyzer_test.sh"], diff --git a/tensorflow/python/debug/examples/v1/debug_tflearn_iris.py b/tensorflow/python/debug/examples/v1/debug_tflearn_iris.py deleted file mode 100644 index 4cd4c903950..00000000000 --- a/tensorflow/python/debug/examples/v1/debug_tflearn_iris.py +++ /dev/null @@ -1,145 +0,0 @@ -# Copyright 2016 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""Debug the tf-learn iris example, based on the tf-learn tutorial.""" -import argparse -import sys -import tempfile - -import tensorflow - -from tensorflow.python import debug as tf_debug - -tf = tensorflow.compat.v1 - -_IRIS_INPUT_DIM = 4 - - -def main(_): - # Generate some fake Iris data. - # It is okay for this example because this example is about how to use the - # debugger, not how to use machine learning to solve the Iris classification - # problem. - def training_input_fn(): - return ({ - "features": tf.random_normal([128, 4]) - }, tf.random_uniform([128], minval=0, maxval=3, dtype=tf.int32)) - - def test_input_fn(): - return ({ - "features": tf.random_normal([32, 4]) - }, tf.random_uniform([32], minval=0, maxval=3, dtype=tf.int32)) - - feature_columns = [tf.feature_column.numeric_column("features", shape=(4,))] - - # Build 3 layer DNN with 10, 20, 10 units respectively. - model_dir = FLAGS.model_dir or tempfile.mkdtemp(prefix="debug_tflearn_iris_") - - classifier = tf.estimator.DNNClassifier( - feature_columns=feature_columns, - hidden_units=[10, 20, 10], - n_classes=3, - model_dir=model_dir) - - if FLAGS.debug and FLAGS.tensorboard_debug_address: - raise ValueError( - "The --debug and --tensorboard_debug_address flags are mutually " - "exclusive.") - hooks = [] - if FLAGS.debug: - if FLAGS.use_random_config_path: - _, config_file_path = tempfile.mkstemp(".tfdbg_config") - else: - config_file_path = None - hooks.append( - tf_debug.LocalCLIDebugHook( - ui_type=FLAGS.ui_type, - dump_root=FLAGS.dump_root, - config_file_path=config_file_path)) - elif FLAGS.tensorboard_debug_address: - hooks.append(tf_debug.TensorBoardDebugHook(FLAGS.tensorboard_debug_address)) - - # Train model, using tfdbg hook. - classifier.train(training_input_fn, steps=FLAGS.train_steps, hooks=hooks) - - # Evaluate accuracy, using tfdbg hook. - accuracy_score = classifier.evaluate( - test_input_fn, steps=FLAGS.eval_steps, hooks=hooks)["accuracy"] - - print("After training %d steps, Accuracy = %f" % - (FLAGS.train_steps, accuracy_score)) - - # Make predictions, using tfdbg hook. - predict_results = classifier.predict(test_input_fn, hooks=hooks) - print("A prediction result: %s" % next(predict_results)) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.register("type", "bool", lambda v: v.lower() == "true") - parser.add_argument( - "--data_dir", - type=str, - default="/tmp/iris_data", - help="Directory to save the training and test data in.") - parser.add_argument( - "--model_dir", - type=str, - default="", - help="Directory to save the trained model in.") - parser.add_argument( - "--train_steps", - type=int, - default=10, - help="Number of steps to run training for.") - parser.add_argument( - "--eval_steps", - type=int, - default=1, - help="Number of steps to run evaluation foir.") - parser.add_argument( - "--ui_type", - type=str, - default="readline", - help="Command-line user interface type (only readline is supported)") - parser.add_argument( - "--debug", - type="bool", - nargs="?", - const=True, - default=False, - help="Use debugger to track down bad values during training. " - "Mutually exclusive with the --tensorboard_debug_address flag.") - parser.add_argument( - "--dump_root", - type=str, - default="", - help="Optional custom root directory for temporary debug dump data") - parser.add_argument( - "--use_random_config_path", - type="bool", - nargs="?", - const=True, - default=False, - help="""If set, set config file path to a random file in the temporary - directory.""") - parser.add_argument( - "--tensorboard_debug_address", - type=str, - default=None, - help="Connect to the TensorBoard Debugger Plugin backend specified by " - "the gRPC address (e.g., localhost:1234). Mutually exclusive with the " - "--debug flag.") - FLAGS, unparsed = parser.parse_known_args() - tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) diff --git a/tensorflow/python/debug/examples/v1/examples_v1_debug_tflearn_iris_test.sh b/tensorflow/python/debug/examples/v1/examples_v1_debug_tflearn_iris_test.sh deleted file mode 100755 index 971b4093f31..00000000000 --- a/tensorflow/python/debug/examples/v1/examples_v1_debug_tflearn_iris_test.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# Copyright 2016 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -# -# Bash unit tests for TensorFlow Debugger (tfdbg) Python examples that do not -# involve downloading data. -# -# Command-line flags: -# --virtualenv: (optional) If set, will test the examples and binaries -# against pip install of TensorFlow in a virtualenv. - -set -e - -# Filter out LOG(INFO) -export TF_CPP_MIN_LOG_LEVEL=1 - -IS_VIRTUALENV=0 -PYTHON_BIN_PATH="" -while true; do - if [[ -z "$1" ]]; then - break - elif [[ "$1" == "--virtualenv" ]]; then - IS_VIRTUALENV=1 - PYTHON_BIN_PATH=$(which python) - echo - echo "IS_VIRTUALENV = ${IS_VIRTUALENV}" - echo "PYTHON_BIN_PATH = ${PYTHON_BIN_PATH}" - echo "Will test tfdbg debug_tflearn_iris against virtualenv pip install." - echo - fi - shift 1 -done - -if [[ -z "${PYTHON_BIN_PATH}" ]]; then - DEBUG_TFLEARN_IRIS_BIN="$TEST_SRCDIR/org_tensorflow/tensorflow/python/debug/examples/v1/debug_tflearn_iris" -else - DEBUG_TFLEARN_IRIS_BIN="${PYTHON_BIN_PATH} -m tensorflow.python.debug.examples.v1.debug_tflearn_iris" -fi - -# Test the custom dump_root option. -CUSTOM_DUMP_ROOT=$(mktemp -d) -mkdir -p ${CUSTOM_DUMP_ROOT} - -# Override the default ui_type=curses to allow the test to pass in a tty-less -# test environment. -cat << EOF | ${DEBUG_TFLEARN_IRIS_BIN} --debug --train_steps=2 --dump_root="${CUSTOM_DUMP_ROOT}" --ui_type=readline --use_random_config_path -run -p -run -f has_inf_or_nan -EOF - -# Verify that the dump root has been cleaned up on exit. -if [[ -d "${CUSTOM_DUMP_ROOT}" ]]; then - echo "ERROR: dump root at ${CUSTOM_DUMP_ROOT} failed to be cleaned up." 1>&2 - exit 1 -fi - -echo -echo "SUCCESS: tfdbg debug_tflearn_iris test PASSED" diff --git a/tensorflow/python/debug/wrappers/hooks.py b/tensorflow/python/debug/wrappers/hooks.py index c9c7515875f..f0d94685e52 100644 --- a/tensorflow/python/debug/wrappers/hooks.py +++ b/tensorflow/python/debug/wrappers/hooks.py @@ -26,10 +26,7 @@ from tensorflow.python.training import session_run_hook class LocalCLIDebugHook(session_run_hook.SessionRunHook): """Command-line-interface debugger hook. - Can be used as a hook for `tf.compat.v1.train.MonitoredSession`s and - `tf.estimator.Estimator`s. Provides a substitute for - `tfdbg.LocalCLIDebugWrapperSession` in cases where the session is not directly - available. + Can be used as a hook for `tf.compat.v1.train.MonitoredSession`. """ def __init__(self, @@ -147,8 +144,7 @@ class LocalCLIDebugHook(session_run_hook.SessionRunHook): class DumpingDebugHook(session_run_hook.SessionRunHook): """A debugger hook that dumps debug data to filesystem. - Can be used as a hook for `tf.compat.v1.train.MonitoredSession`s and - `tf.estimator.Estimator`s. + Can be used as a hook for `tf.compat.v1.train.MonitoredSession`. """ def __init__(self, @@ -222,8 +218,7 @@ class GrpcDebugHook(session_run_hook.SessionRunHook): When the arguments of debug_utils.watch_graph changes, strongly consider changing arguments here too so that features are available to tflearn users. - Can be used as a hook for `tf.compat.v1.train.MonitoredSession`s and - `tf.estimator.Estimator`s. + Can be used as a hook for `tf.compat.v1.train.MonitoredSession`. """ def __init__(self, diff --git a/tensorflow/python/distribute/BUILD b/tensorflow/python/distribute/BUILD index 01fd8ca4d13..576e62d501c 100644 --- a/tensorflow/python/distribute/BUILD +++ b/tensorflow/python/distribute/BUILD @@ -827,23 +827,6 @@ tpu_py_strict_test( ], ) -# Used only by estimator. -py_strict_library( - name = "estimator_training", - srcs = [ - "estimator_training.py", - ], - srcs_version = "PY3", - deps = [ - ":distribute_coordinator", - ":distribute_coordinator_context", - ":multi_worker_util", - "//tensorflow/python/platform:tf_logging", - "//tensorflow/python/training:server_lib", - "@six_archive//:six", - ], -) - py_strict_library( name = "reduce_util", srcs = ["reduce_util.py"], @@ -1756,14 +1739,9 @@ distribute_py_strict_test( ":distribute_utils", ":strategy_combinations", ":values", - "//tensorflow/python/eager:context", "//tensorflow/python/eager:test", - "//tensorflow/python/framework:constant_op", - "//tensorflow/python/framework:ops", - "//tensorflow/python/ops:array_ops", "//tensorflow/python/ops:variable_scope", "//tensorflow/python/ops:variable_v1", - "//tensorflow/python/saved_model/model_utils:mode_keys", "@absl_py//absl/testing:parameterized", "@pypi_wrapt//:pkg", ], @@ -2258,7 +2236,6 @@ cuda_py_strict_test( "//tensorflow/python/distribute/v1:input_lib", "//tensorflow/python/eager:backprop", "//tensorflow/python/eager:context", - "//tensorflow/python/estimator:run_config", "//tensorflow/python/framework:constant_op", "//tensorflow/python/framework:device", "//tensorflow/python/framework:dtypes", diff --git a/tensorflow/python/distribute/README.md b/tensorflow/python/distribute/README.md index 26a62dacb30..1bb41222b3d 100644 --- a/tensorflow/python/distribute/README.md +++ b/tensorflow/python/distribute/README.md @@ -6,7 +6,7 @@ tf.distribute.Strategy is a TensorFlow API to distribute training across multiple GPUs, multiple machines or TPUs. Using this API, users can distribute their existing models and training code with minimal code changes. -It can be used with TensorFlow's high level APIs, tf.keras and tf.estimator, +It can be used with TensorFlow's high level APIs, like tf.keras, with just a couple of lines of code change. It does so by changing the underlying components of TensorFlow to become strategy-aware. This includes variables, layers, models, optimizers, metrics, summaries, @@ -22,8 +22,6 @@ and checkpoints. [Multiworker Training With Keras Tutorial](https://www.tensorflow.org/tutorials/distribute/multi_worker_with_keras) -[Multiworker Training With Estimator Tutorial](https://www.tensorflow.org/tutorials/distribute/multi_worker_with_estimator) - [Save and Load with Distribution Strategy](https://www.tensorflow.org/tutorials/distribute/save_and_load) ## Simple Examples diff --git a/tensorflow/python/distribute/__init__.py b/tensorflow/python/distribute/__init__.py index 86dc16cfd36..82a8ddfd854 100644 --- a/tensorflow/python/distribute/__init__.py +++ b/tensorflow/python/distribute/__init__.py @@ -4,7 +4,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -#     http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -35,9 +35,8 @@ v1.x](https://github.com/tensorflow/docs/blob/master/site/en/r1/guide/distribute Tutorials](https://www.tensorflow.org/tutorials/distribute/) The tutorials cover how to use `tf.distribute.Strategy` to do distributed - training with native Keras APIs, custom training loops, - and Estimator APIs. They also cover how to save/load model when using - `tf.distribute.Strategy`. + training with native Keras APIs, and custom training loops. + They also cover how to save/load model when using `tf.distribute.Strategy`. *Glossary* diff --git a/tensorflow/python/distribute/collective_all_reduce_strategy.py b/tensorflow/python/distribute/collective_all_reduce_strategy.py index 92ff459b497..c6a48e3bdd6 100644 --- a/tensorflow/python/distribute/collective_all_reduce_strategy.py +++ b/tensorflow/python/distribute/collective_all_reduce_strategy.py @@ -1001,10 +1001,7 @@ class CollectiveAllReduceExtended(mirrored_strategy.MirroredExtended): # to limit the backward incompatibility. if hasattr(self, "_check_health_thread"): raise ValueError( - "MultiWorkerMirroredStrategy cannot be deep copied in eager mode. " - "If you're using Estimator and see this error message, call " - "tf.compat.v1.disable_eager_execution() at the beginning of your " - "program") + "MultiWorkerMirroredStrategy cannot be deep copied in eager mode.") # Otherwise, do a regular deepcopy. cls = self.__class__ result = cls.__new__(cls) diff --git a/tensorflow/python/distribute/collective_all_reduce_strategy_test.py b/tensorflow/python/distribute/collective_all_reduce_strategy_test.py index 9721a53fe59..cb77a84f00f 100644 --- a/tensorflow/python/distribute/collective_all_reduce_strategy_test.py +++ b/tensorflow/python/distribute/collective_all_reduce_strategy_test.py @@ -755,7 +755,6 @@ class ExperimentalCompatibilityTest(test.TestCase): _CollectiveAllReduceStrategyExperimental) def testName(self): - # Estimator checks the __name__ to special case MultiWorkerMirroredStrategy. self.assertEqual(CollectiveAllReduceStrategy.__name__, 'CollectiveAllReduceStrategy') self.assertEqual(_CollectiveAllReduceStrategyExperimental.__name__, diff --git a/tensorflow/python/distribute/distribute_lib.py b/tensorflow/python/distribute/distribute_lib.py index 55e7fb57e1f..965e0ea1c17 100644 --- a/tensorflow/python/distribute/distribute_lib.py +++ b/tensorflow/python/distribute/distribute_lib.py @@ -36,9 +36,8 @@ v1.x](https://github.com/tensorflow/docs/blob/master/site/en/r1/guide/distribute Tutorials](https://www.tensorflow.org/tutorials/distribute/) The tutorials cover how to use `tf.distribute.Strategy` to do distributed - training with native Keras APIs, custom training loops, - and Estimator APIs. They also cover how to save/load model when using - `tf.distribute.Strategy`. + training with native Keras APIs, and custom training loops. + They also cover how to save/load model when using `tf.distribute.Strategy`. *Glossary* @@ -1100,10 +1099,6 @@ class StrategyBase(object): * To use it with Keras `compile`/`fit`, [please read](https://www.tensorflow.org/guide/distributed_training#using_tfdistributestrategy_with_keras). - * You may pass descendant of `tf.distribute.Strategy` to - `tf.estimator.RunConfig` to specify how a `tf.estimator.Estimator` - should distribute its computation. See - [guide](https://www.tensorflow.org/guide/distributed_training#using_tfdistributestrategy_with_estimator_limited_support). * Otherwise, use `tf.distribute.Strategy.scope` to specify that a strategy should be used when building an executing your model. (This puts you in the "cross-replica context" for this strategy, which @@ -1181,9 +1176,6 @@ class StrategyBase(object): def __init__(self, extended): self._extended = extended - # Flag that is used to indicate whether distribution strategy is used with - # Estimator. This is required for backward compatibility of loss scaling - # when using v1 optimizer with estimator. self._scale_loss_for_estimator = False if not hasattr(extended, "_retrace_functions_for_each_device"): diff --git a/tensorflow/python/distribute/distribute_utils.py b/tensorflow/python/distribute/distribute_utils.py index 185eec3b6e0..73ef2fcf0f5 100644 --- a/tensorflow/python/distribute/distribute_utils.py +++ b/tensorflow/python/distribute/distribute_utils.py @@ -40,9 +40,6 @@ from tensorflow.python.util.tf_export import tf_export def get_loss_reduction(): """`tf.distribute.ReduceOp` corresponding to the last loss reduction. - This is used to decide whether loss should be scaled in optimizer (used only - for estimator + v1 optimizer use case). - Returns: `tf.distribute.ReduceOp` corresponding to the last loss reduction for estimator and v1 optimizer use case. `tf.distribute.ReduceOp.SUM` otherwise. diff --git a/tensorflow/python/distribute/distribute_utils_test.py b/tensorflow/python/distribute/distribute_utils_test.py index 0ec36703eb9..d547110f166 100644 --- a/tensorflow/python/distribute/distribute_utils_test.py +++ b/tensorflow/python/distribute/distribute_utils_test.py @@ -24,14 +24,9 @@ from tensorflow.python.distribute import combinations from tensorflow.python.distribute import distribute_utils from tensorflow.python.distribute import strategy_combinations from tensorflow.python.distribute import values -from tensorflow.python.eager import context from tensorflow.python.eager import test -from tensorflow.python.framework import constant_op -from tensorflow.python.framework import ops -from tensorflow.python.ops import array_ops from tensorflow.python.ops import variable_scope from tensorflow.python.ops import variable_v1 -from tensorflow.python.saved_model.model_utils import mode_keys def _nested_value(d): @@ -188,52 +183,6 @@ class RegroupAndSelectDeviceTest(test.TestCase, parameterized.TestCase): self.assertEqual(_nested_value("1"), distribute_utils.select_replica(0, result)) - def testNamedTuple(self): - - # We include toy implementations of Scaffold and EstimatorSpec to - # avoid a dependency on Estimator here. - - class Scaffold(object): - pass - - class EstimatorSpec(collections.namedtuple( - "EstimatorSpec", ["mode", "loss", "train_op", "scaffold"])): - - def __new__(cls, mode, loss, train_op, scaffold=None): - return super(EstimatorSpec, cls).__new__( - cls, mode=mode, loss=loss, train_op=train_op, - scaffold=scaffold or Scaffold()) - - with context.graph_mode(), ops.Graph().as_default(): - created_estimator_specs = [] - - for device_id in range(3): - spec = EstimatorSpec( - mode=mode_keys.EstimatorModeKeys.TRAIN, - loss=constant_op.constant(device_id / 2), - train_op=array_ops.identity(constant_op.constant(device_id))) - created_estimator_specs.append(spec) - - merged_estimator_spec = distribute_utils.regroup(created_estimator_specs) - - self.assertIsInstance(merged_estimator_spec, EstimatorSpec) - self.assertEqual(mode_keys.EstimatorModeKeys.TRAIN, - merged_estimator_spec.mode) - for device_id in range(3): - self.assertEqual(created_estimator_specs[device_id].loss, - merged_estimator_spec.loss.values[device_id]) - self.assertEqual(created_estimator_specs[device_id].train_op, - merged_estimator_spec.train_op.values[device_id]) - # Scaffold is populated by `EstimatorSpec.__new__`. - self.assertEqual(created_estimator_specs[device_id].scaffold, - merged_estimator_spec.scaffold.values[device_id]) - self.assertIsInstance(created_estimator_specs[device_id].scaffold, - Scaffold) - # Also test that we can undo the merge using select_replica() - self.assertEqual(created_estimator_specs[device_id], - distribute_utils.select_replica( - device_id, merged_estimator_spec)) - def testWrappedNamedTuple(self): Point = collections.namedtuple("Point", ["x", "y"]) point1 = Point(x=0, y=2) diff --git a/tensorflow/python/distribute/estimator_training.py b/tensorflow/python/distribute/estimator_training.py deleted file mode 100644 index c5367e0e7c0..00000000000 --- a/tensorflow/python/distribute/estimator_training.py +++ /dev/null @@ -1,387 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""Training utilities for Estimator to use Distribute Coordinator.""" - -import copy - -import six - -from tensorflow.python.distribute import distribute_coordinator as dc -from tensorflow.python.distribute import distribute_coordinator_context as dc_context -from tensorflow.python.distribute import multi_worker_util -from tensorflow.python.platform import tf_logging as logging -from tensorflow.python.training import server_lib - -# pylint: disable=protected-access -CHIEF = dc._TaskType.CHIEF -EVALUATOR = dc._TaskType.EVALUATOR -PS = dc._TaskType.PS -WORKER = dc._TaskType.WORKER - -# pylint: enable=protected-access - - -def _count_ps(cluster_spec): - """Counts the number of parameter servers in cluster_spec.""" - if not cluster_spec: - raise RuntimeError( - 'Internal error: `_count_ps` does not expect empty cluster_spec.') - - return len(cluster_spec.as_dict().get(PS, [])) - - -def _count_worker(cluster_spec, chief_task_type): - """Counts the number of workers (including chief) in cluster_spec.""" - if not cluster_spec: - raise RuntimeError( - 'Internal error: `_count_worker` does not expect empty cluster_spec.') - - return (len(cluster_spec.as_dict().get(WORKER, [])) + len( - cluster_spec.as_dict().get(chief_task_type, []))) - - -def _get_global_id(cluster_spec, task_type, task_id, chief_task_type): - """Returns the global id of the given task type in a cluster.""" - if not task_type: - return 0 - - # Sort task names in cluster by "chief"/"master", "evaluator", "worker" - # and "ps". More details can be found at the documentation of - # `tf.estimator.RunConfig.global_id_in_cluster`. - task_type_ordered_list = [] - if chief_task_type in cluster_spec.jobs: - task_type_ordered_list = [chief_task_type] - task_type_ordered_list.extend([ - t for t in sorted(cluster_spec.jobs) if t != chief_task_type and t != PS - ]) - if PS in cluster_spec.jobs: - task_type_ordered_list.append(PS) - - # Find the right global_id for current task. - next_global_id = 0 - for t in task_type_ordered_list: - if t == task_type: - return next_global_id + task_id - # `cluster_spec.job_tasks` returns all task addresses of type `t`. - next_global_id += len(cluster_spec.job_tasks(t)) - - # It is unexpected that it passes through all task_types in - # `task_type_ordered_list`. - raise RuntimeError('Internal Error: `task_type` ({}) is not in ' - 'cluster_spec ({}).'.format(task_type, cluster_spec)) - - -def _init_run_config_from_worker_context(config, worker_context): - """Initializes run config from distribute coordinator's worker context.""" - - # pylint: disable=protected-access - config._service = None - config._cluster_spec = worker_context.cluster_spec - config._task_type = worker_context.task_type - config._task_id = worker_context.task_id - config._evaluation_master = worker_context.master_target - config._master = worker_context.master_target - config._is_chief = worker_context.is_chief - - if config._cluster_spec: - # Distributed mode. - if config._task_type != EVALUATOR: - - config._num_ps_replicas = _count_ps(config._cluster_spec) - config._num_worker_replicas = _count_worker( - config._cluster_spec, chief_task_type=CHIEF) - config._global_id_in_cluster = _get_global_id( - config._cluster_spec, - config._task_type, - config._task_id, - chief_task_type=CHIEF) - else: - # Evaluator task should not be aware of the other tasks. - config._cluster_spec = server_lib.ClusterSpec({}) - config._num_ps_replicas = 0 - config._num_worker_replicas = 0 - config._global_id_in_cluster = None # undefined - else: - # Local mode. - config._global_id_in_cluster = 0 - config._num_ps_replicas = 0 - config._num_worker_replicas = 1 - - -def init_run_config(config, tf_config): - """Initializes RunConfig for distribution strategies.""" - # pylint: disable=protected-access - if (config._experimental_distribute and - config._experimental_distribute.train_distribute): - if config._train_distribute: - raise ValueError('Either `train_distribute` or' - '`experimental_distribute.train_distribute` can be set.') - config._train_distribute = config._experimental_distribute.train_distribute - - if (config._experimental_distribute and - config._experimental_distribute.eval_distribute): - if config._eval_distribute: - raise ValueError('Either `eval_distribute` or' - '`experimental_distribute.eval_distribute` can be set.') - config._eval_distribute = config._experimental_distribute.eval_distribute - - cluster_spec = server_lib.ClusterSpec(tf_config.get('cluster', {})) - config._init_distributed_setting_from_environment_var({}) - - # Use distribute coordinator with STANDALONE_CLIENT mode if - # `experimental_distribute.remote_cluster` is set. - if (config._train_distribute and config._experimental_distribute and - config._experimental_distribute.remote_cluster): - if cluster_spec: - raise ValueError('Cannot set both "cluster_spec" of TF_CONFIG and ' - '`experimental_distribute.remote_cluster`') - config._distribute_coordinator_mode = dc.CoordinatorMode.STANDALONE_CLIENT - config._cluster_spec = config._experimental_distribute.remote_cluster - logging.info('RunConfig initialized for Distribute Coordinator with ' - 'STANDALONE_CLIENT mode') - return - - # Don't use distribute coordinator if it is local training or cluster has a - # MASTER job or `train_distribute` is not specified. - if (not cluster_spec or 'master' in cluster_spec.jobs or - not config._train_distribute): - config._distribute_coordinator_mode = None - config._init_distributed_setting_from_environment_var(tf_config) - config._maybe_overwrite_session_config_for_distributed_training() - logging.info('Not using Distribute Coordinator.') - return - - # Use distribute coordinator with INDEPENDENT_WORKER mode otherwise. - assert tf_config - - # Set the cluster_spec only since the distributed setting will come from - # distribute coordinator. - config._cluster_spec = cluster_spec - config._distribute_coordinator_mode = dc.CoordinatorMode.INDEPENDENT_WORKER - logging.info('RunConfig initialized for Distribute Coordinator with ' - 'INDEPENDENT_WORKER mode') - - -def should_run_distribute_coordinator(config): - """Checks the config to see whether to run distribute coordinator.""" - # pylint: disable=protected-access - if (not hasattr(config, '_distribute_coordinator_mode') or - config._distribute_coordinator_mode is None): - logging.info('Not using Distribute Coordinator.') - return False - if (not isinstance(config._distribute_coordinator_mode, six.string_types) or - config._distribute_coordinator_mode not in [ - dc.CoordinatorMode.STANDALONE_CLIENT, - dc.CoordinatorMode.INDEPENDENT_WORKER - ]): - logging.warning('Unexpected distribute_coordinator_mode: %r', - config._distribute_coordinator_mode) - return False - if not config.cluster_spec: - logging.warning('Running `train_and_evaluate` locally, ignoring ' - '`experimental_distribute_coordinator_mode`.') - return False - return True - - -def train_and_evaluate(estimator, train_spec, eval_spec, executor_cls): - """Run distribute coordinator for Estimator's `train_and_evaluate`. - - Args: - estimator: An `Estimator` instance to train and evaluate. - train_spec: A `TrainSpec` instance to specify the training specification. - eval_spec: A `EvalSpec` instance to specify the evaluation and export - specification. - executor_cls: the evaluation executor class of Estimator. - - Raises: - ValueError: if `distribute_coordinator_mode` is None in RunConfig. - """ - run_config = estimator.config - if not run_config._distribute_coordinator_mode: # pylint: disable=protected-access - raise ValueError( - 'Distribute coordinator mode is not specified in `RunConfig`.') - - def _worker_fn(strategy): - """Function for worker task.""" - local_estimator = copy.deepcopy(estimator) - # pylint: disable=protected-access - local_estimator._config._train_distribute = strategy - context = dc_context.get_current_worker_context() - _init_run_config_from_worker_context(local_estimator._config, context) - logging.info('Updated config: %s', str(vars(local_estimator._config))) - local_estimator._train_distribution = strategy - # pylint: enable=protected-access - - # In the standalone client, we don't need to run hooks on all threads - # because logging hooks on all threads may be too much on the screen; also - # tensor passed to one hook can only be fetched with the graph where the - # tensor is defined. Other hooks such as checkpointing hooks will added by - # MonitoredTrainingSession. - # TODO(yuefengz): Is there a hook that does need to run on all threads in - # standalone client mode? - if (run_config._distribute_coordinator_mode == # pylint: disable=protected-access - dc.CoordinatorMode.INDEPENDENT_WORKER or context.is_chief): - hooks = list(train_spec.hooks) - else: - hooks = [] - - # Prevent estimator.train from calling distribute coordinator again. This - # function calls estimator.train which will use distribute coordinator path - # again if `_distribute_coordinator_mode` is set. - local_estimator._config._distribute_coordinator_mode = None # pylint: disable=protected-access - local_estimator.train( - input_fn=train_spec.input_fn, - max_steps=train_spec.max_steps, - hooks=hooks) - - def _eval_fn(strategy): - """Function for evaluator task.""" - local_estimator = copy.deepcopy(estimator) - # pylint: disable=protected-access - local_estimator._config._eval_distribute = strategy - _init_run_config_from_worker_context( - local_estimator._config, dc_context.get_current_worker_context()) - logging.info('Updated config: %s', str(vars(local_estimator._config))) - local_estimator._eval_distribution = strategy - - # Prevent estimator.evaluate from calling distribute coordinator again. This - # function calls estimator.evaluate which will use distribute coordinator - # path again if `_distribute_coordinator_mode` is set. - local_estimator._config._distribute_coordinator_mode = None # pylint: disable=protected-access - - executor = executor_cls(local_estimator, train_spec, eval_spec) - executor._start_continuous_evaluation() - # pylint: enable=protected-access - - # pylint: disable=protected-access - if (run_config._distribute_coordinator_mode == - dc.CoordinatorMode.STANDALONE_CLIENT): - cluster_spec = run_config.cluster_spec - assert cluster_spec - else: - # The cluster_spec comes from TF_CONFIG environment variable if it is - # INDEPENDENT_WORKER mode. - cluster_spec = None - - dc.run_distribute_coordinator( - _worker_fn, - run_config.train_distribute, - _eval_fn, - run_config.eval_distribute, - mode=run_config._distribute_coordinator_mode, - cluster_spec=cluster_spec, - session_config=run_config.session_config) - - -# TODO(yuefengz): maybe merge the following two functions? -# pylint: disable=protected-access -def estimator_train(estimator, train_distributed_fn, hooks): - """Run distribute coordinator for Estimator's `train` method.""" - assert estimator._config._distribute_coordinator_mode - run_config = estimator._config - assert estimator._config.cluster_spec - cluster_spec = multi_worker_util.normalize_cluster_spec( - estimator._config.cluster_spec) - assert estimator._config._train_distribute - - if 'evaluator' in cluster_spec.jobs: - raise ValueError("'evaluator' job is not supported if you don't use " - '`train_and_evaluate`') - - if (estimator._config._distribute_coordinator_mode != # pylint: disable=protected-access - dc.CoordinatorMode.STANDALONE_CLIENT): - raise ValueError('Only `STANDALONE_CLIENT` mode is supported when you call ' - '`estimator.train`') - - if estimator._config._train_distribute.extended.experimental_between_graph: - # TODO(yuefengz): remove this limitation once we figure out how to merge - # return values from `_worker_fn`s. - raise ValueError('`Estimator.train` API is not supported for %s with ' - '`STANDALONE_CLIENT` mode.' % - estimator._config._train_distribute.__class__.__name__) - - def _worker_fn(strategy): - """Function for worker task.""" - local_estimator = copy.deepcopy(estimator) - local_estimator._config._train_distribute = strategy - context = dc_context.get_current_worker_context() - _init_run_config_from_worker_context(local_estimator._config, context) - logging.info('Updated config: %s', str(vars(local_estimator._config))) - local_estimator._train_distribution = strategy - - if context.is_chief: - chief_hooks = hooks - else: - chief_hooks = [] - train_distributed_fn(local_estimator, strategy, chief_hooks) - return local_estimator - - return dc.run_distribute_coordinator( - _worker_fn, - estimator._config.train_distribute, - mode=run_config._distribute_coordinator_mode, - cluster_spec=cluster_spec, - session_config=run_config.session_config) - - -def estimator_evaluate(estimator, evaluate_distributed_fn, hooks): - """Run distribute coordinator for Estimator's `evaluate` method.""" - assert estimator._config._distribute_coordinator_mode - run_config = estimator._config - assert estimator._config.cluster_spec - cluster_spec = multi_worker_util.normalize_cluster_spec( - estimator._config.cluster_spec) - assert estimator._config._eval_distribute - - if 'evaluator' in cluster_spec.jobs: - raise ValueError("'evaluator' job is not supported if you don't use " - '`train_and_evaluate`') - - if (estimator._config._distribute_coordinator_mode != - dc.CoordinatorMode.STANDALONE_CLIENT): - raise ValueError('Only `STANDALONE_CLIENT` mode is supported when you call ' - '`Estimator.evaluate`') - - if estimator._config._eval_distribute.extended.experimental_between_graph: - # TODO(yuefengz): remove this limitation once we figure out how to merge - # return values from `_worker_fn`s. - raise ValueError('`Estimator.evaluate` API is not supported for %s with ' - '`STANDALONE_CLIENT` mode.' % - estimator._config._eval_distribute.__class__.__name__) - - def _worker_fn(strategy): - """Function for evaluation.""" - local_estimator = copy.deepcopy(estimator) - local_estimator._config._eval_distribute = strategy - context = dc_context.get_current_worker_context() - _init_run_config_from_worker_context(local_estimator._config, context) - logging.info('Updated config: %s', str(vars(local_estimator._config))) - local_estimator._eval_distribution = strategy - - if context.is_chief: - chief_hooks = hooks - else: - chief_hooks = [] - return evaluate_distributed_fn(local_estimator, strategy, chief_hooks) - - return dc.run_distribute_coordinator( - _worker_fn, - estimator._config.eval_distribute, - mode=run_config._distribute_coordinator_mode, - cluster_spec=cluster_spec, - session_config=run_config.session_config) - -# pylint: enable=protected-access diff --git a/tensorflow/python/distribute/multi_worker_util.py b/tensorflow/python/distribute/multi_worker_util.py index 082dbdf7abb..5ea391ae24c 100644 --- a/tensorflow/python/distribute/multi_worker_util.py +++ b/tensorflow/python/distribute/multi_worker_util.py @@ -60,7 +60,7 @@ def _validate_cluster_spec(cluster_spec, 2) whether there is such a task type as `task_type` in the `cluster_spec`. The only exception is `evaluator`. In other words, it is still a valid configuration when `task_type` is `evaluator` but it doesn't appear in - `cluster_spec`. This is to be compatible with `TF_CONFIG` in Estimator. + `cluster_spec`. 3) whether there is at most one "chief" job. 4) whether there is at most one "evaluator" job. 5) whether the `task_id` is smaller than the number of tasks for that diff --git a/tensorflow/python/distribute/parameter_server_strategy_test.py b/tensorflow/python/distribute/parameter_server_strategy_test.py index 3ce0aaa3e2d..fb59cd754bb 100644 --- a/tensorflow/python/distribute/parameter_server_strategy_test.py +++ b/tensorflow/python/distribute/parameter_server_strategy_test.py @@ -35,7 +35,6 @@ from tensorflow.python.distribute.cluster_resolver import cluster_resolver as cl from tensorflow.python.distribute.v1 import input_lib as input_lib_v1 from tensorflow.python.eager import backprop from tensorflow.python.eager import context -from tensorflow.python.estimator import run_config from tensorflow.python.framework import constant_op from tensorflow.python.framework import device as tf_device from tensorflow.python.framework import dtypes @@ -54,9 +53,9 @@ from tensorflow.python.ops import variables from tensorflow.python.platform import test from tensorflow.python.training import training_util -CHIEF = run_config.TaskType.CHIEF -WORKER = run_config.TaskType.WORKER -PS = run_config.TaskType.PS +CHIEF = 'chief' +WORKER = 'worker' +PS = 'ps' def _get_replica_id_integer(): diff --git a/tensorflow/python/distribute/tpu_strategy.py b/tensorflow/python/distribute/tpu_strategy.py index 9c2b3443a41..245a1a6b86e 100644 --- a/tensorflow/python/distribute/tpu_strategy.py +++ b/tensorflow/python/distribute/tpu_strategy.py @@ -766,7 +766,7 @@ class TPUStrategyV1(distribute_lib.StrategyV1): host. Note that this can have side-effects on performance, hooks, metrics, summaries etc. This parameter is only used when Distribution Strategy is used with - estimator or keras. + Keras. device_assignment: Optional `tf.tpu.experimental.DeviceAssignment` to specify the placement of replicas on the TPU cluster. Currently only supports the usecase of using a single core within a TPU cluster. diff --git a/tensorflow/python/estimator/BUILD b/tensorflow/python/estimator/BUILD deleted file mode 100644 index afc1af80b80..00000000000 --- a/tensorflow/python/estimator/BUILD +++ /dev/null @@ -1,388 +0,0 @@ -load("//tensorflow:py.default.bzl", "py_library") - -package( - # copybara:uncomment default_applicable_licenses = ["//tensorflow:license"], - default_visibility = ["//tensorflow:internal"], - licenses = ["notice"], -) - -py_library( - name = "estimator_py", - srcs = [ - "estimator_lib.py", - ], - srcs_version = "PY3", - visibility = [ - "//tensorflow:__pkg__", - "//tensorflow:internal", - ], - deps = [ - ":baseline", - ":dnn", - ":dnn_linear_combined", - ":estimator", - ":expect_tensorflow_estimator_installed", - ":export", - ":exporter", - ":inputs", - ":keras", - ":linear", - ":model_fn", - ":parsing_utils", - ":run_config", - ":training", - "//tensorflow:tensorflow_py_no_contrib", - ], -) - -py_library( - name = "exporter", - srcs = ["exporter.py"], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - ":gc", - ":metric_keys", - ":util", - "//tensorflow:tensorflow_py_no_contrib", - ], -) - -py_library( - name = "gc", - srcs = ["gc.py"], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - "//tensorflow:tensorflow_py_no_contrib", - ], -) - -py_library( - name = "model_fn", - srcs = ["model_fn.py"], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - ":export_output", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "training", - srcs = ["training.py"], - srcs_version = "PY3", - deps = [ - ":estimator", - ":expect_tensorflow_estimator_installed", - ":exporter", - ":run_config", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "run_config", - srcs = ["run_config.py"], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "baseline", - srcs = ["canned/baseline.py"], - srcs_version = "PY3", - deps = [ - ":estimator", - ":expect_tensorflow_estimator_installed", - ":head", - ":model_fn", - ":optimizers", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "dnn", - srcs = ["canned/dnn.py"], - srcs_version = "PY3", - deps = [ - ":estimator", - ":expect_tensorflow_estimator_installed", - ":head", - ":model_fn", - ":optimizers", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "dnn_testing_utils", - testonly = 1, - srcs = ["canned/dnn_testing_utils.py"], - srcs_version = "PY3", - deps = [ - ":estimator", - ":expect_tensorflow_estimator_installed", - ":head", - ":metric_keys", - ":model_fn", - ":numpy_io", - ":prediction_keys", - "//tensorflow:tensorflow_py_no_contrib", - "//third_party/py/numpy", - "@absl_py//absl/testing:parameterized", - "@six_archive//:six", - ], -) - -py_library( - name = "dnn_linear_combined", - srcs = ["canned/dnn_linear_combined.py"], - srcs_version = "PY3", - deps = [ - ":dnn", - ":estimator", - ":expect_tensorflow_estimator_installed", - ":head", - ":linear", - ":model_fn", - ":optimizers", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "util", - srcs = [ - "util.py", - ], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - "//tensorflow:tensorflow_py_no_contrib", - ], -) - -py_library( - name = "estimator", - srcs = [ - "estimator.py", - ], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - ":export_export", - ":model_fn", - ":run_config", - ":util", - "//tensorflow:tensorflow_py_no_contrib", - "//third_party/py/numpy", - "@six_archive//:six", - ], -) - -py_library( - name = "parsing_utils", - srcs = [ - "canned/parsing_utils.py", - ], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "export_output", - srcs = ["export/export_output.py"], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "export", - srcs = [ - "export/export_lib.py", - ], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - ":export_export", - ":export_output", - "//tensorflow:tensorflow_py_no_contrib", - ], -) - -py_library( - name = "export_export", - srcs = [ - "export/export.py", - ], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - ":util", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "head", - srcs = ["canned/head.py"], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - ":export_output", - ":metric_keys", - ":model_fn", - ":prediction_keys", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "inputs", - srcs = ["inputs/inputs.py"], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - ":numpy_io", - ":pandas_io", - "//tensorflow:tensorflow_py_no_contrib", - ], -) - -py_library( - name = "linear", - srcs = ["canned/linear.py"], - srcs_version = "PY3", - deps = [ - ":estimator", - ":expect_tensorflow_estimator_installed", - ":head", - ":optimizers", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "linear_testing_utils", - testonly = 1, - srcs = ["canned/linear_testing_utils.py"], - srcs_version = "PY3", - deps = [ - ":estimator", - ":expect_tensorflow_estimator_installed", - ":export_export", - ":linear", - ":metric_keys", - ":numpy_io", - ":pandas_io", - ":run_config", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "metric_keys", - srcs = ["canned/metric_keys.py"], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - ":model_fn", - ], -) - -py_library( - name = "numpy_io", - srcs = ["inputs/numpy_io.py"], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - ":inputs_queues", - ], -) - -py_library( - name = "optimizers", - srcs = ["canned/optimizers.py"], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "pandas_io", - srcs = ["inputs/pandas_io.py"], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - ":inputs_queues", - ], -) - -py_library( - name = "prediction_keys", - srcs = ["canned/prediction_keys.py"], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - ], -) - -py_library( - name = "inputs_queues", - srcs = [ - "inputs/queues/feeding_functions.py", - "inputs/queues/feeding_queue_runner.py", - ], - srcs_version = "PY3", - deps = [ - ":expect_tensorflow_estimator_installed", - "//tensorflow:tensorflow_py_no_contrib", - "@six_archive//:six", - ], -) - -py_library( - name = "keras", - srcs = ["keras.py"], - srcs_version = "PY3", - deps = [ - ":estimator", - ":expect_tensorflow_estimator_installed", - ":export_export", - ":model_fn", - ":run_config", - "//tensorflow:tensorflow_py_no_contrib", - ], -) - -alias( - name = "expect_tensorflow_estimator_installed", - actual = "@pypi_tf_estimator_nightly//:pkg", -) diff --git a/tensorflow/python/estimator/canned/baseline.py b/tensorflow/python/estimator/canned/baseline.py deleted file mode 100644 index 65fb13a8918..00000000000 --- a/tensorflow/python/estimator/canned/baseline.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""baseline python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.canned import baseline - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -baseline.__all__ = [s for s in dir(baseline) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.canned.baseline import * diff --git a/tensorflow/python/estimator/canned/dnn.py b/tensorflow/python/estimator/canned/dnn.py deleted file mode 100644 index d45b045b91f..00000000000 --- a/tensorflow/python/estimator/canned/dnn.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""dnn python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.canned import dnn - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -dnn.__all__ = [s for s in dir(dnn) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.canned.dnn import * diff --git a/tensorflow/python/estimator/canned/dnn_linear_combined.py b/tensorflow/python/estimator/canned/dnn_linear_combined.py deleted file mode 100644 index ec0b27170c3..00000000000 --- a/tensorflow/python/estimator/canned/dnn_linear_combined.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""dnn_linear_combined python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.canned import dnn_linear_combined - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -dnn_linear_combined.__all__ = [ - s for s in dir(dnn_linear_combined) if not s.startswith('__') -] - -from tensorflow_estimator.python.estimator.canned.dnn_linear_combined import * diff --git a/tensorflow/python/estimator/canned/dnn_testing_utils.py b/tensorflow/python/estimator/canned/dnn_testing_utils.py deleted file mode 100644 index 8ae6d40c246..00000000000 --- a/tensorflow/python/estimator/canned/dnn_testing_utils.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""dnn_testing_utils python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.canned import dnn_testing_utils - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -dnn_testing_utils.__all__ = [ - s for s in dir(dnn_testing_utils) if not s.startswith('__') -] - -from tensorflow_estimator.python.estimator.canned.dnn_testing_utils import * diff --git a/tensorflow/python/estimator/canned/head.py b/tensorflow/python/estimator/canned/head.py deleted file mode 100644 index d1af4d78ed7..00000000000 --- a/tensorflow/python/estimator/canned/head.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""head python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.canned import head - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -head.__all__ = [s for s in dir(head) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.canned.head import * diff --git a/tensorflow/python/estimator/canned/linear.py b/tensorflow/python/estimator/canned/linear.py deleted file mode 100644 index 50588079c02..00000000000 --- a/tensorflow/python/estimator/canned/linear.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""linear python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.canned import linear - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -linear.__all__ = [s for s in dir(linear) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.canned.linear import * diff --git a/tensorflow/python/estimator/canned/linear_testing_utils.py b/tensorflow/python/estimator/canned/linear_testing_utils.py deleted file mode 100644 index 014167e8a23..00000000000 --- a/tensorflow/python/estimator/canned/linear_testing_utils.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""linear_testing_utils python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.canned import linear_testing_utils - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -linear_testing_utils.__all__ = [ - s for s in dir(linear_testing_utils) if not s.startswith('__') -] - -from tensorflow_estimator.python.estimator.canned.linear_testing_utils import * diff --git a/tensorflow/python/estimator/canned/metric_keys.py b/tensorflow/python/estimator/canned/metric_keys.py deleted file mode 100644 index 4d0df59c0eb..00000000000 --- a/tensorflow/python/estimator/canned/metric_keys.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""metric_keys python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.canned import metric_keys - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -metric_keys.__all__ = [s for s in dir(metric_keys) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.canned.metric_keys import * diff --git a/tensorflow/python/estimator/canned/optimizers.py b/tensorflow/python/estimator/canned/optimizers.py deleted file mode 100644 index 66cc56673a9..00000000000 --- a/tensorflow/python/estimator/canned/optimizers.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""optimizers python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.canned import optimizers - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -optimizers.__all__ = [s for s in dir(optimizers) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.canned.optimizers import * diff --git a/tensorflow/python/estimator/canned/parsing_utils.py b/tensorflow/python/estimator/canned/parsing_utils.py deleted file mode 100644 index e3f66b70a2d..00000000000 --- a/tensorflow/python/estimator/canned/parsing_utils.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""parsing_utils python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.canned import parsing_utils - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -parsing_utils.__all__ = [ - s for s in dir(parsing_utils) if not s.startswith('__') -] - -from tensorflow_estimator.python.estimator.canned.parsing_utils import * diff --git a/tensorflow/python/estimator/canned/prediction_keys.py b/tensorflow/python/estimator/canned/prediction_keys.py deleted file mode 100644 index e7278795b2e..00000000000 --- a/tensorflow/python/estimator/canned/prediction_keys.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""prediction_keys python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.canned import prediction_keys - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -prediction_keys.__all__ = [ - s for s in dir(prediction_keys) if not s.startswith('__') -] - -from tensorflow_estimator.python.estimator.canned.prediction_keys import * diff --git a/tensorflow/python/estimator/estimator.py b/tensorflow/python/estimator/estimator.py deleted file mode 100644 index a55f3bc1e36..00000000000 --- a/tensorflow/python/estimator/estimator.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""estimator python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator import estimator - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -estimator.__all__ = [s for s in dir(estimator) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.estimator import * diff --git a/tensorflow/python/estimator/estimator_lib.py b/tensorflow/python/estimator/estimator_lib.py deleted file mode 100644 index 1f4b9046c60..00000000000 --- a/tensorflow/python/estimator/estimator_lib.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""estimator_lib python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator import estimator_lib - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -estimator_lib.__all__ = [ - s for s in dir(estimator_lib) if not s.startswith('__') -] - -from tensorflow_estimator.python.estimator.estimator_lib import * diff --git a/tensorflow/python/estimator/export/export.py b/tensorflow/python/estimator/export/export.py deleted file mode 100644 index 627c25aa4bb..00000000000 --- a/tensorflow/python/estimator/export/export.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""export python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.export import export - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -export.__all__ = [s for s in dir(export) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.export.export import * diff --git a/tensorflow/python/estimator/export/export_lib.py b/tensorflow/python/estimator/export/export_lib.py deleted file mode 100644 index c3f2758952b..00000000000 --- a/tensorflow/python/estimator/export/export_lib.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""export_lib python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.export import export_lib - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -export_lib.__all__ = [s for s in dir(export_lib) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.export.export_lib import * diff --git a/tensorflow/python/estimator/export/export_output.py b/tensorflow/python/estimator/export/export_output.py deleted file mode 100644 index 54e1587254d..00000000000 --- a/tensorflow/python/estimator/export/export_output.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""export_output python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.export import export_output - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -export_output.__all__ = [ - s for s in dir(export_output) if not s.startswith('__') -] - -from tensorflow_estimator.python.estimator.export.export_output import * diff --git a/tensorflow/python/estimator/exporter.py b/tensorflow/python/estimator/exporter.py deleted file mode 100644 index 2096794a264..00000000000 --- a/tensorflow/python/estimator/exporter.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""exporter python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator import exporter - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -exporter.__all__ = [s for s in dir(exporter) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.exporter import * diff --git a/tensorflow/python/estimator/gc.py b/tensorflow/python/estimator/gc.py deleted file mode 100644 index 8a28a59b1c2..00000000000 --- a/tensorflow/python/estimator/gc.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""gc python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator import gc - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -gc.__all__ = [s for s in dir(gc) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.gc import * diff --git a/tensorflow/python/estimator/inputs/inputs.py b/tensorflow/python/estimator/inputs/inputs.py deleted file mode 100644 index 4fb9bb6ac1a..00000000000 --- a/tensorflow/python/estimator/inputs/inputs.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""inputs python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.inputs import inputs - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -inputs.__all__ = [s for s in dir(inputs) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.inputs.inputs import * diff --git a/tensorflow/python/estimator/inputs/numpy_io.py b/tensorflow/python/estimator/inputs/numpy_io.py deleted file mode 100644 index 881866d39e7..00000000000 --- a/tensorflow/python/estimator/inputs/numpy_io.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""numpy_io python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.inputs import numpy_io - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -numpy_io.__all__ = [s for s in dir(numpy_io) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.inputs.numpy_io import * diff --git a/tensorflow/python/estimator/inputs/pandas_io.py b/tensorflow/python/estimator/inputs/pandas_io.py deleted file mode 100644 index 8a1959ab2e9..00000000000 --- a/tensorflow/python/estimator/inputs/pandas_io.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""pandas_io python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.inputs import pandas_io - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -pandas_io.__all__ = [s for s in dir(pandas_io) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.inputs.pandas_io import * diff --git a/tensorflow/python/estimator/inputs/queues/__init__.py b/tensorflow/python/estimator/inputs/queues/__init__.py deleted file mode 100644 index 419f4166669..00000000000 --- a/tensorflow/python/estimator/inputs/queues/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""queues python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.inputs import queues - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -queues.__all__ = [s for s in dir(queues) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.inputs.queues import * diff --git a/tensorflow/python/estimator/inputs/queues/feeding_functions.py b/tensorflow/python/estimator/inputs/queues/feeding_functions.py deleted file mode 100644 index 58cd3c5b3aa..00000000000 --- a/tensorflow/python/estimator/inputs/queues/feeding_functions.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""feeding_functions python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.inputs.queues import feeding_functions - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -feeding_functions.__all__ = [ - s for s in dir(feeding_functions) if not s.startswith('__') -] - -from tensorflow_estimator.python.estimator.inputs.queues.feeding_functions import * diff --git a/tensorflow/python/estimator/inputs/queues/feeding_queue_runner.py b/tensorflow/python/estimator/inputs/queues/feeding_queue_runner.py deleted file mode 100644 index ccae0c98def..00000000000 --- a/tensorflow/python/estimator/inputs/queues/feeding_queue_runner.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""feeding_queue_runner python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator.inputs.queues import feeding_queue_runner - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -feeding_queue_runner.__all__ = [ - s for s in dir(feeding_queue_runner) if not s.startswith('__') -] - -from tensorflow_estimator.python.estimator.inputs.queues.feeding_queue_runner import * diff --git a/tensorflow/python/estimator/keras.py b/tensorflow/python/estimator/keras.py deleted file mode 100644 index b1ab5df9eab..00000000000 --- a/tensorflow/python/estimator/keras.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""keras python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator import keras_lib - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -keras_lib.__all__ = [s for s in dir(keras_lib) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.keras_lib import * diff --git a/tensorflow/python/estimator/model_fn.py b/tensorflow/python/estimator/model_fn.py deleted file mode 100644 index 96c09d5d43c..00000000000 --- a/tensorflow/python/estimator/model_fn.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""model_fn python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator import model_fn - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -model_fn.__all__ = [s for s in dir(model_fn) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.model_fn import * diff --git a/tensorflow/python/estimator/run_config.py b/tensorflow/python/estimator/run_config.py deleted file mode 100644 index 65dbd2a26d8..00000000000 --- a/tensorflow/python/estimator/run_config.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""run_config python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator import run_config - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -run_config.__all__ = [s for s in dir(run_config) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.run_config import * diff --git a/tensorflow/python/estimator/training.py b/tensorflow/python/estimator/training.py deleted file mode 100644 index 768c35dd49e..00000000000 --- a/tensorflow/python/estimator/training.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""training python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator import training - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -training.__all__ = [s for s in dir(training) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.training import * diff --git a/tensorflow/python/estimator/util.py b/tensorflow/python/estimator/util.py deleted file mode 100644 index 112e3a825a3..00000000000 --- a/tensorflow/python/estimator/util.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""util python module. - -Importing from tensorflow.python.estimator is unsupported -and will soon break! -""" -# pylint: disable=unused-import,g-bad-import-order,g-import-not-at-top,wildcard-import - -from tensorflow_estimator.python.estimator import util - -# Include attrs that start with single underscore. -_HAS_DYNAMIC_ATTRIBUTES = True -util.__all__ = [s for s in dir(util) if not s.startswith('__')] - -from tensorflow_estimator.python.estimator.util import * diff --git a/tensorflow/python/feature_column/feature_column.py b/tensorflow/python/feature_column/feature_column.py index 0f82f1fbad2..89c235d6cec 100644 --- a/tensorflow/python/feature_column/feature_column.py +++ b/tensorflow/python/feature_column/feature_column.py @@ -14,111 +14,9 @@ # ============================================================================== """This API defines FeatureColumn abstraction. -FeatureColumns provide a high level abstraction for ingesting and representing -features. FeatureColumns are also the primary way of encoding features for -canned `tf.estimator.Estimator`s. - -When using FeatureColumns with `Estimators`, the type of feature column you -should choose depends on (1) the feature type and (2) the model type. - -1. Feature type: - - * Continuous features can be represented by `numeric_column`. - * Categorical features can be represented by any `categorical_column_with_*` - column: - - `categorical_column_with_vocabulary_list` - - `categorical_column_with_vocabulary_file` - - `categorical_column_with_hash_bucket` - - `categorical_column_with_identity` - - `weighted_categorical_column` - -2. Model type: - - * Deep neural network models (`DNNClassifier`, `DNNRegressor`). - - Continuous features can be directly fed into deep neural network models. - - age_column = numeric_column("age") - - To feed sparse features into DNN models, wrap the column with - `embedding_column` or `indicator_column`. `indicator_column` is recommended - for features with only a few possible values. For features with many - possible values, to reduce the size of your model, `embedding_column` is - recommended. - - embedded_dept_column = embedding_column( - categorical_column_with_vocabulary_list( - "department", ["math", "philosophy", ...]), dimension=10) - - * Wide (aka linear) models (`LinearClassifier`, `LinearRegressor`). - - Sparse features can be fed directly into linear models. They behave like an - indicator column but with an efficient implementation. - - dept_column = categorical_column_with_vocabulary_list("department", - ["math", "philosophy", "english"]) - - It is recommended that continuous features be bucketized before being - fed into linear models. - - bucketized_age_column = bucketized_column( - source_column=age_column, - boundaries=[18, 25, 30, 35, 40, 45, 50, 55, 60, 65]) - - Sparse features can be crossed (also known as conjuncted or combined) in - order to form non-linearities, and then fed into linear models. - - cross_dept_age_column = crossed_column( - columns=["department", bucketized_age_column], - hash_bucket_size=1000) - -Example of building canned `Estimator`s using FeatureColumns: - - ```python - # Define features and transformations - deep_feature_columns = [age_column, embedded_dept_column] - wide_feature_columns = [dept_column, bucketized_age_column, - cross_dept_age_column] - - # Build deep model - estimator = DNNClassifier( - feature_columns=deep_feature_columns, - hidden_units=[500, 250, 50]) - estimator.train(...) - - # Or build a wide model - estimator = LinearClassifier( - feature_columns=wide_feature_columns) - estimator.train(...) - - # Or build a wide and deep model! - estimator = DNNLinearCombinedClassifier( - linear_feature_columns=wide_feature_columns, - dnn_feature_columns=deep_feature_columns, - dnn_hidden_units=[500, 250, 50]) - estimator.train(...) - ``` - - FeatureColumns can also be transformed into a generic input layer for custom models using `input_layer`. -Example of building model using FeatureColumns, this can be used in a -`model_fn` which is given to the {tf.estimator.Estimator}: - - ```python - # Building model via layers - - deep_feature_columns = [age_column, embedded_dept_column] - columns_to_tensor = parse_feature_columns_from_examples( - serialized=my_data, - feature_columns=deep_feature_columns) - first_layer = input_layer( - features=columns_to_tensor, - feature_columns=deep_feature_columns) - second_layer = fully_connected(first_layer, ...) - ``` - NOTE: Functions prefixed with "_" indicate experimental or private parts of the API subject to change, and should not be relied upon! @@ -850,35 +748,6 @@ def _embedding_column(categorical_column, `categorical_column_*` function. Here is an example of using `embedding_column` with `DNNClassifier`: - ```python - video_id = categorical_column_with_identity( - key='video_id', num_buckets=1000000, default_value=0) - columns = [embedding_column(video_id, 9),...] - - estimator = tf.estimator.DNNClassifier(feature_columns=columns, ...) - - label_column = ... - def input_fn(): - features = tf.io.parse_example( - ..., features=make_parse_example_spec(columns + [label_column])) - labels = features.pop(label_column.name) - return features, labels - - estimator.train(input_fn=input_fn, steps=100) - ``` - - Here is an example using `embedding_column` with model_fn: - - ```python - def model_fn(features, ...): - video_id = categorical_column_with_identity( - key='video_id', num_buckets=1000000, default_value=0) - columns = [embedding_column(video_id, 9),...] - dense_tensor = input_layer(features, columns) - # Form DNN layers, calculate loss, and return EstimatorSpec. - ... - ``` - Args: categorical_column: A `_CategoricalColumn` created by a `categorical_column_with_*` function. This column produces the sparse IDs diff --git a/tensorflow/python/feature_column/feature_column_v2.py b/tensorflow/python/feature_column/feature_column_v2.py index c1e5e22867c..70d3294ee02 100644 --- a/tensorflow/python/feature_column/feature_column_v2.py +++ b/tensorflow/python/feature_column/feature_column_v2.py @@ -15,110 +15,11 @@ """This API defines FeatureColumn abstraction. FeatureColumns provide a high level abstraction for ingesting and representing -features. FeatureColumns are also the primary way of encoding features for -canned `tf.estimator.Estimator`s. - -When using FeatureColumns with `Estimators`, the type of feature column you -should choose depends on (1) the feature type and (2) the model type. - -1. Feature type: - - * Continuous features can be represented by `numeric_column`. - * Categorical features can be represented by any `categorical_column_with_*` - column: - - `categorical_column_with_vocabulary_list` - - `categorical_column_with_vocabulary_file` - - `categorical_column_with_hash_bucket` - - `categorical_column_with_identity` - - `weighted_categorical_column` - -2. Model type: - - * Deep neural network models (`DNNClassifier`, `DNNRegressor`). - - Continuous features can be directly fed into deep neural network models. - - age_column = numeric_column("age") - - To feed sparse features into DNN models, wrap the column with - `embedding_column` or `indicator_column`. `indicator_column` is recommended - for features with only a few possible values. For features with many - possible values, to reduce the size of your model, `embedding_column` is - recommended. - - embedded_dept_column = embedding_column( - categorical_column_with_vocabulary_list( - "department", ["math", "philosophy", ...]), dimension=10) - - * Wide (aka linear) models (`LinearClassifier`, `LinearRegressor`). - - Sparse features can be fed directly into linear models. They behave like an - indicator column but with an efficient implementation. - - dept_column = categorical_column_with_vocabulary_list("department", - ["math", "philosophy", "english"]) - - It is recommended that continuous features be bucketized before being - fed into linear models. - - bucketized_age_column = bucketized_column( - source_column=age_column, - boundaries=[18, 25, 30, 35, 40, 45, 50, 55, 60, 65]) - - Sparse features can be crossed (also known as conjuncted or combined) in - order to form non-linearities, and then fed into linear models. - - cross_dept_age_column = crossed_column( - columns=["department", bucketized_age_column], - hash_bucket_size=1000) - -Example of building canned `Estimator`s using FeatureColumns: - - ```python - # Define features and transformations - deep_feature_columns = [age_column, embedded_dept_column] - wide_feature_columns = [dept_column, bucketized_age_column, - cross_dept_age_column] - - # Build deep model - estimator = DNNClassifier( - feature_columns=deep_feature_columns, - hidden_units=[500, 250, 50]) - estimator.train(...) - - # Or build a wide model - estimator = LinearClassifier( - feature_columns=wide_feature_columns) - estimator.train(...) - - # Or build a wide and deep model! - estimator = DNNLinearCombinedClassifier( - linear_feature_columns=wide_feature_columns, - dnn_feature_columns=deep_feature_columns, - dnn_hidden_units=[500, 250, 50]) - estimator.train(...) - ``` - +features. FeatureColumns can also be transformed into a generic input layer for custom models using `input_layer`. -Example of building model using FeatureColumns, this can be used in a -`model_fn` which is given to the {tf.estimator.Estimator}: - - ```python - # Building model via layers - - deep_feature_columns = [age_column, embedded_dept_column] - columns_to_tensor = parse_feature_columns_from_examples( - serialized=my_data, - feature_columns=deep_feature_columns) - first_layer = input_layer( - features=columns_to_tensor, - feature_columns=deep_feature_columns) - second_layer = fully_connected(first_layer, ...) - ``` - NOTE: Functions prefixed with "_" indicate experimental or private parts of the API subject to change, and should not be relied upon! """ @@ -548,39 +449,6 @@ def embedding_column(categorical_column, Use this when your inputs are sparse, but you want to convert them to a dense representation (e.g., to feed to a DNN). - Inputs must be a `CategoricalColumn` created by any of the - `categorical_column_*` function. Here is an example of using - `embedding_column` with `DNNClassifier`: - - ```python - video_id = categorical_column_with_identity( - key='video_id', num_buckets=1000000, default_value=0) - columns = [embedding_column(video_id, 9),...] - - estimator = tf.estimator.DNNClassifier(feature_columns=columns, ...) - - label_column = ... - def input_fn(): - features = tf.io.parse_example( - ..., features=make_parse_example_spec(columns + [label_column])) - labels = features.pop(label_column.name) - return features, labels - - estimator.train(input_fn=input_fn, steps=100) - ``` - - Here is an example using `embedding_column` with model_fn: - - ```python - def model_fn(features, ...): - video_id = categorical_column_with_identity( - key='video_id', num_buckets=1000000, default_value=0) - columns = [embedding_column(video_id, 9),...] - dense_tensor = input_layer(features, columns) - # Form DNN layers, calculate loss, and return EstimatorSpec. - ... - ``` - Args: categorical_column: A `CategoricalColumn` created by a `categorical_column_with_*` function. This column produces the sparse IDs @@ -675,43 +543,6 @@ def shared_embedding_columns(categorical_columns, categorical_column_with_vocabulary_file with the same vocabulary_file. Some or all columns could also be weighted_categorical_column. - Here is an example embedding of two features for a DNNClassifier model: - - ```python - watched_video_id = categorical_column_with_vocabulary_file( - 'watched_video_id', video_vocabulary_file, video_vocabulary_size) - impression_video_id = categorical_column_with_vocabulary_file( - 'impression_video_id', video_vocabulary_file, video_vocabulary_size) - columns = shared_embedding_columns( - [watched_video_id, impression_video_id], dimension=10) - - estimator = tf.estimator.DNNClassifier(feature_columns=columns, ...) - - label_column = ... - def input_fn(): - features = tf.io.parse_example( - ..., features=make_parse_example_spec(columns + [label_column])) - labels = features.pop(label_column.name) - return features, labels - - estimator.train(input_fn=input_fn, steps=100) - ``` - - Here is an example using `shared_embedding_columns` with model_fn: - - ```python - def model_fn(features, ...): - watched_video_id = categorical_column_with_vocabulary_file( - 'watched_video_id', video_vocabulary_file, video_vocabulary_size) - impression_video_id = categorical_column_with_vocabulary_file( - 'impression_video_id', video_vocabulary_file, video_vocabulary_size) - columns = shared_embedding_columns( - [watched_video_id, impression_video_id], dimension=10) - dense_tensor = input_layer(features, columns) - # Form DNN layers, calculate loss, and return EstimatorSpec. - ... - ``` - Args: categorical_columns: List of categorical columns created by a `categorical_column_with_*` function. These columns produce the sparse IDs @@ -871,43 +702,6 @@ def shared_embedding_columns_v2(categorical_columns, categorical_column_with_vocabulary_file with the same vocabulary_file. Some or all columns could also be weighted_categorical_column. - Here is an example embedding of two features for a DNNClassifier model: - - ```python - watched_video_id = categorical_column_with_vocabulary_file( - 'watched_video_id', video_vocabulary_file, video_vocabulary_size) - impression_video_id = categorical_column_with_vocabulary_file( - 'impression_video_id', video_vocabulary_file, video_vocabulary_size) - columns = shared_embedding_columns( - [watched_video_id, impression_video_id], dimension=10) - - estimator = tf.estimator.DNNClassifier(feature_columns=columns, ...) - - label_column = ... - def input_fn(): - features = tf.io.parse_example( - ..., features=make_parse_example_spec(columns + [label_column])) - labels = features.pop(label_column.name) - return features, labels - - estimator.train(input_fn=input_fn, steps=100) - ``` - - Here is an example using `shared_embedding_columns` with model_fn: - - ```python - def model_fn(features, ...): - watched_video_id = categorical_column_with_vocabulary_file( - 'watched_video_id', video_vocabulary_file, video_vocabulary_size) - impression_video_id = categorical_column_with_vocabulary_file( - 'impression_video_id', video_vocabulary_file, video_vocabulary_size) - columns = shared_embedding_columns( - [watched_video_id, impression_video_id], dimension=10) - dense_tensor = input_layer(features, columns) - # Form DNN layers, calculate loss, and return EstimatorSpec. - ... - ``` - Args: categorical_columns: List of categorical columns created by a `categorical_column_with_*` function. These columns produce the sparse IDs diff --git a/tensorflow/python/framework/BUILD b/tensorflow/python/framework/BUILD index a697162b4b9..4fb1b45555a 100644 --- a/tensorflow/python/framework/BUILD +++ b/tensorflow/python/framework/BUILD @@ -2088,7 +2088,6 @@ pytype_strict_library( srcs_version = "PY3", visibility = visibility + [ "//tensorflow:internal", - "//tensorflow_estimator/python/estimator:__subpackages__", "//tensorflow_model_optimization:__subpackages__", "//third_party/cloud_tpu/convergence_tools:__subpackages__", "//third_party/py/neural_structured_learning:__subpackages__", diff --git a/tensorflow/python/framework/op_callbacks_test.py b/tensorflow/python/framework/op_callbacks_test.py index d0a872bfc43..9826ff38cd4 100644 --- a/tensorflow/python/framework/op_callbacks_test.py +++ b/tensorflow/python/framework/op_callbacks_test.py @@ -609,8 +609,6 @@ class OpCallbacksTest(test_util.TensorFlowTestCase): greater_op_outputs = instrument.graph_internal_ndarrays[_GREATER_OP] self.assertEqual(len(greater_op_outputs), 1) self.assertAllClose(greater_op_outputs[0], False) - # This was needed for backwards compatibility with TF2 Estimators which - # rely on variable names. prefix = b"cond/" if context.executing_eagerly() else b"" pow_op_outputs = instrument.graph_internal_ndarrays[b"%spow" % prefix] self.assertEqual(len(pow_op_outputs), 1) diff --git a/tensorflow/python/framework/ops.py b/tensorflow/python/framework/ops.py index aff887206d9..eea52396572 100644 --- a/tensorflow/python/framework/ops.py +++ b/tensorflow/python/framework/ops.py @@ -187,9 +187,7 @@ def _as_graph_element(obj): return None -# Deprecated - do not use. -# This API to avoid breaking estimator and tensorflow-mesh which depend on this -# internal API. The stub should be safe to use after TF 2.3 is released. +# Deprecated - legacy purposes only. def is_dense_tensor_like(t) -> bool: return isinstance(t, core_tf_types.Tensor) @@ -2036,13 +2034,10 @@ class Graph(pywrap_tf_session.PyGraph): # actual outside graph). self._graph_key = "graph-key-%d/" % (uid(),) # A string with the last reduction method passed to - # losses.compute_weighted_loss(), or None. This is required only for - # backward compatibility with Estimator and optimizer V1 use cases. + # losses.compute_weighted_loss(), or None. + # Backward compatibility with optimizer V1 use cases. self._last_loss_reduction = None - # Flag that is used to indicate whether loss has been scaled by optimizer. - # If this flag has been set, then estimator uses it to scale losss back - # before reporting. This is required only for backward compatibility with - # Estimator and optimizer V1 use cases. + # Required only for backward compatibility with optimizer V1 use cases. self._is_loss_scaled_by_optimizer = False self._container = "" diff --git a/tensorflow/python/keras/engine/base_layer_utils.py b/tensorflow/python/keras/engine/base_layer_utils.py index 0fd0b92d377..dfa0f207a01 100644 --- a/tensorflow/python/keras/engine/base_layer_utils.py +++ b/tensorflow/python/keras/engine/base_layer_utils.py @@ -194,8 +194,6 @@ def create_keras_history(tensors): # (Only via Savedmodels). It may also change the semantics of whether # generated random numbers are generated once and re-used, or recomputed # each time. -# Note: This path triggers for TPUEstimators / xla compiled graphs regardless -# of this setting. _UNSAFE_GRAPH_OP_LAYER_CREATION = False diff --git a/tensorflow/python/keras/engine/base_layer_v1.py b/tensorflow/python/keras/engine/base_layer_v1.py index 3cb10b36212..b1e8d3ed0c8 100644 --- a/tensorflow/python/keras/engine/base_layer_v1.py +++ b/tensorflow/python/keras/engine/base_layer_v1.py @@ -838,13 +838,10 @@ class Layer(base_layer.Layer): raise ValueError( 'Your Layer or Model is in an invalid state. ' 'This can happen for the following cases:\n ' - '1. You might be interleaving estimator/non-estimator models or ' - 'interleaving models/layers made in tf.compat.v1.Graph.as_default() ' - 'with models/layers created outside of it. ' - 'Converting a model to an estimator (via model_to_estimator) ' - 'invalidates all models/layers made before the conversion (even ' - 'if they were not the model converted to an estimator). ' - 'Similarly, making a layer or a model inside a ' + '1. You might be interleaving models/layers made in ' + 'tf.compat.v1.Graph.as_default() with models/layers created ' + 'outside of it.\n' + 'Making a layer or a model inside a ' 'a tf.compat.v1.Graph invalidates all layers/models you previously ' 'made outside of the graph.\n' '2. You might be using a custom keras layer implementation with ' diff --git a/tensorflow/python/keras/engine/training_v1.py b/tensorflow/python/keras/engine/training_v1.py index f0843908e4b..0fca9e4ee4c 100644 --- a/tensorflow/python/keras/engine/training_v1.py +++ b/tensorflow/python/keras/engine/training_v1.py @@ -361,7 +361,7 @@ class Model(training_lib.Model): parameter_server_strategy.ParameterServerStrategyV1): raise NotImplementedError( '`tf.compat.v1.distribute.experimental.ParameterServerStrategy` ' - 'currently only works with the tf.Estimator API') + 'currently only works with the deprecated tf.Estimator API') if isinstance(self._distribution_strategy, parameter_server_strategy_v2.ParameterServerStrategyV2): @@ -1513,9 +1513,7 @@ class Model(training_lib.Model): """Compiles the model loss and weighted metric sub-graphs. This may be used to set graph tensors as sample weights (instead of creating - placeholders). This functionality is necessary for - `tf.keras.estimator.model_to_estimator`, which calls Keras models in a v1 - graph, and creates iterator tensors for inputs, targets, and sample weights. + placeholders). Args: sample_weights: List of tensors to use as the sample weights. Must be the diff --git a/tensorflow/python/keras/regularizers.py b/tensorflow/python/keras/regularizers.py index 634ea39f0e4..86f79a30d33 100644 --- a/tensorflow/python/keras/regularizers.py +++ b/tensorflow/python/keras/regularizers.py @@ -147,11 +147,10 @@ class Regularizer(object): training and executing models, exporting to and from SavedModels, or saving and loading weight checkpoints. - Registration is required for Keras `model_to_estimator`, saving and - loading models to HDF5 formats, Keras model cloning, some visualization - utilities, and exporting models to and from JSON. If using this functionality, - you must make sure any python process running your model has also defined - and registered your custom regularizer. + Registration is required for saving and loading models to HDF5 formats, + Keras model cloning, some visualization utilities, and exporting models to and + from JSON. If using this functionality, you must make sure any python process + running your model has also defined and registered your custom regularizer. `tf.keras.utils.register_keras_serializable` is only available in TF 2.1 and beyond. In earlier versions of TensorFlow you must pass your custom @@ -171,9 +170,9 @@ class Regularizer(object): capable of instantiating the same regularizer from the config dictionary. - This method is used by Keras `model_to_estimator`, saving and - loading models to HDF5 formats, Keras model cloning, some visualization - utilities, and exporting models to and from JSON. + This method is used by saving and loading models to HDF5 formats, + Keras model cloning, some visualization utilities, + and exporting models to and from JSON. Args: config: A Python dictionary, typically the output of get_config. @@ -194,9 +193,9 @@ class Regularizer(object): This method is optional if you are just training and executing models, exporting to and from SavedModels, or using weight checkpoints. - This method is required for Keras `model_to_estimator`, saving and - loading models to HDF5 formats, Keras model cloning, some visualization - utilities, and exporting models to and from JSON. + This method is required for saving and loading models to HDF5 formats, + Keras model cloning, some visualization utilities, + and exporting models to and from JSON. Returns: Python dictionary. diff --git a/tensorflow/python/keras/saving/saved_model_experimental.py b/tensorflow/python/keras/saving/saved_model_experimental.py index 2b0067274f8..d92fd8217df 100644 --- a/tensorflow/python/keras/saving/saved_model_experimental.py +++ b/tensorflow/python/keras/saving/saved_model_experimental.py @@ -189,8 +189,7 @@ def _save_v1_format(model, path, custom_objects, as_text, input_signature): # one save is needed once the weights can be copied from the model to clone. checkpoint_path = _export_model_variables(model, path) - # Export each mode. Use ModeKeys enums defined for `Estimator` to ensure that - # Keras models and `Estimator`s are exported with the same format. + # Export each mode. # Every time a mode is exported, the code checks to see if new variables have # been created (e.g. optimizer slot variables). If that is the case, the # checkpoint is re-saved to include the new variables. @@ -234,7 +233,7 @@ def _export_mode( """Exports a model, and optionally saves new vars from the clone model. Args: - mode: A `tf.estimator.ModeKeys` string. + mode: A `KerasModeKeys` string. has_saved_vars: A `boolean` indicating whether the SavedModel has already exported variables. builder: A `SavedModelBuilder` object. @@ -271,8 +270,7 @@ def _export_mode( # Make sure that iterations variable is added to the global step collection, # to ensure that, when the SavedModel graph is loaded, the iterations - # variable is returned by `tf.compat.v1.train.get_global_step()`. This is - # required for compatibility with the SavedModelEstimator. + # variable is returned by `tf.compat.v1.train.get_global_step()`. if compile_clone: g.add_to_collection(ops.GraphKeys.GLOBAL_STEP, clone.optimizer.iterations) diff --git a/tensorflow/python/keras/saving/saving_utils.py b/tensorflow/python/keras/saving/saving_utils.py index ef86aa26ae9..4ad05f6f1bf 100644 --- a/tensorflow/python/keras/saving/saving_utils.py +++ b/tensorflow/python/keras/saving/saving_utils.py @@ -34,7 +34,7 @@ from tensorflow.python.util import nest def extract_model_metrics(model): """Convert metrics from a Keras model `compile` API to dictionary. - This is used for converting Keras models to Estimators and SavedModels. + This is used for converting Keras models to SavedModels. Args: model: A `tf.keras.Model` object. @@ -44,7 +44,6 @@ def extract_model_metrics(model): the model does not contain any metrics. """ if getattr(model, '_compile_metrics', None): - # TODO(psv/kathywu): use this implementation in model to estimator flow. # We are not using model.metrics here because we want to exclude the metrics # added using `add_metric` API. return {m.name: m for m in model._compile_metric_functions} # pylint: disable=protected-access diff --git a/tensorflow/python/keras/saving/utils_v1/__init__.py b/tensorflow/python/keras/saving/utils_v1/__init__.py index 63128a7374a..8b69a21c060 100644 --- a/tensorflow/python/keras/saving/utils_v1/__init__.py +++ b/tensorflow/python/keras/saving/utils_v1/__init__.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== # LINT.IfChange -"""Utils for saving a Keras Model or Estimator to the SavedModel format.""" +"""Utils for saving a Keras Model to the SavedModel format.""" # pylint: disable=wildcard-import from tensorflow.python.keras.saving.utils_v1.export_output import * from tensorflow.python.keras.saving.utils_v1.export_utils import build_all_signature_defs diff --git a/tensorflow/python/keras/saving/utils_v1/export_utils.py b/tensorflow/python/keras/saving/utils_v1/export_utils.py index 4688e88c22b..1c95d19bffd 100644 --- a/tensorflow/python/keras/saving/utils_v1/export_utils.py +++ b/tensorflow/python/keras/saving/utils_v1/export_utils.py @@ -270,7 +270,7 @@ def export_outputs_for_mode( metric_value must be a Tensor, and update_op must be a Tensor or Op Returns: - Dictionary mapping the a key to an `tf.estimator.export.ExportOutput` object + Dictionary mapping the key to an `ExportOutput` object. The key is the expected SignatureDef key for the mode. Raises: @@ -279,8 +279,6 @@ def export_outputs_for_mode( if mode not in SIGNATURE_KEY_MAP: raise ValueError( 'Export output type not found for mode: {}. Expected one of: {}.\n' - 'One likely error is that V1 Estimator Modekeys were somehow passed to ' - 'this function. Please ensure that you are using the new ModeKeys.' .format(mode, SIGNATURE_KEY_MAP.keys())) signature_key = SIGNATURE_KEY_MAP[mode] if mode_keys.is_predict(mode): diff --git a/tensorflow/python/keras/saving/utils_v1/mode_keys.py b/tensorflow/python/keras/saving/utils_v1/mode_keys.py index d777cc56296..6c8abd8adb3 100644 --- a/tensorflow/python/keras/saving/utils_v1/mode_keys.py +++ b/tensorflow/python/keras/saving/utils_v1/mode_keys.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== # LINT.IfChange -"""Utils for managing different mode strings used by Keras and Estimator models. +"""Utils for managing different mode strings used by Keras models. """ import collections @@ -34,44 +34,24 @@ class KerasModeKeys: PREDICT = 'predict' -# TODO(kathywu): Remove copy in Estimator after nightlies -class EstimatorModeKeys: - """Standard names for Estimator model modes. - - The following standard keys are defined: - - * `TRAIN`: training/fitting mode. - * `EVAL`: testing/evaluation mode. - * `PREDICT`: predication/inference mode. - """ - - TRAIN = 'train' - EVAL = 'eval' - PREDICT = 'infer' - - def is_predict(mode): - return mode in [KerasModeKeys.PREDICT, EstimatorModeKeys.PREDICT] + return mode == KerasModeKeys.PREDICT def is_eval(mode): - return mode in [KerasModeKeys.TEST, EstimatorModeKeys.EVAL] + return mode == KerasModeKeys.TEST def is_train(mode): - return mode in [KerasModeKeys.TRAIN, EstimatorModeKeys.TRAIN] + return mode == KerasModeKeys.TRAIN class ModeKeyMap(collections.abc.Mapping): """Map using ModeKeys as keys. This class creates an immutable mapping from modes to values. For example, - SavedModel export of Keras and Estimator models use this to map modes to their + SavedModel export of Keras models use this to map modes to their corresponding MetaGraph tags/SignatureDef keys. - - Since this class uses modes, rather than strings, as keys, both "predict" - (Keras's PREDICT ModeKey) and "infer" (Estimator's PREDICT ModeKey) map to the - same value. """ def __init__(self, **kwargs): diff --git a/tensorflow/python/kernel_tests/control_flow/control_flow_ops_py_test.py b/tensorflow/python/kernel_tests/control_flow/control_flow_ops_py_test.py index f7e8f846a80..e2cb0c2d5fa 100644 --- a/tensorflow/python/kernel_tests/control_flow/control_flow_ops_py_test.py +++ b/tensorflow/python/kernel_tests/control_flow/control_flow_ops_py_test.py @@ -874,8 +874,6 @@ class ControlFlowTest(test.TestCase, parameterized.TestCase): return tf_cond.cond( pred, lambda: true_fn(inputs), lambda: false_fn(inputs)) - # This was needed for backwards compatibility with TF2 Estimators which - # rely on variable names. prefix = "cond/" if context.executing_eagerly() else "" with self.assertRaisesRegex( @@ -907,8 +905,6 @@ class ControlFlowTest(test.TestCase, parameterized.TestCase): lambda: br4_fn(inputs) ]) - # This was needed for backwards compatibility with TF2 Estimators which - # rely on variable names. prefix = "switch_case/indexed_case/" if context.executing_eagerly() else "" with self.assertRaisesRegex( ValueError, "Tensor %sbr1_identity:0 in branch 1 is " diff --git a/tensorflow/python/ops/BUILD b/tensorflow/python/ops/BUILD index f0aafb3240c..2da4f034f0c 100644 --- a/tensorflow/python/ops/BUILD +++ b/tensorflow/python/ops/BUILD @@ -578,10 +578,7 @@ tf_gen_op_strict_wrapper_private_py( tf_gen_op_strict_wrapper_private_py( name = "sdca_ops_gen", - visibility = [ - "//tensorflow/python:__pkg__", - "//tensorflow_estimator/python/estimator/canned/linear_optimizer:__pkg__", - ], + visibility = ["//tensorflow/python:__pkg__"], ) tf_gen_op_strict_wrapper_private_py( diff --git a/tensorflow/python/ops/clustering_ops.py b/tensorflow/python/ops/clustering_ops.py index 049ae582ec7..dd7a6945e8f 100644 --- a/tensorflow/python/ops/clustering_ops.py +++ b/tensorflow/python/ops/clustering_ops.py @@ -47,7 +47,6 @@ RANDOM_INIT = 'random' KMEANS_PLUS_PLUS_INIT = 'kmeans_plus_plus' KMC2_INIT = 'kmc2' -# The name of the variable holding the cluster centers. Used by the Estimator. CLUSTERS_VAR_NAME = 'clusters' diff --git a/tensorflow/python/ops/control_flow_util_v2.py b/tensorflow/python/ops/control_flow_util_v2.py index 3d3618028e7..db66adfbc41 100644 --- a/tensorflow/python/ops/control_flow_util_v2.py +++ b/tensorflow/python/ops/control_flow_util_v2.py @@ -406,15 +406,15 @@ def set_output_all_intermediates(state): # pylint: disable=invalid-name """Whether to output all intermediates from functional control flow ops. The "default" behavior to is to output all intermediates when using v2 control - flow inside Keras models in graph mode (possibly inside Estimators). This is - needed to support taking gradients of v2 control flow. In graph mode, Keras - can sometimes freeze the forward graph before the gradient computation which - does not work for v2 control flow since it requires updating the forward ops - to output the needed intermediates. We work around this by proactively - outputting the needed intermediates when building the forward pass itself. - Ideally any such extra tensors should be pruned out at runtime. However, if - for any reason this doesn't work for you or if you have an inference-only - model you can turn this behavior off using + flow inside Keras models in graph mode. This is needed to support taking + gradients of v2 control flow. In graph mode, Keras can sometimes freeze the + forward graph before the gradient computation which does not work for v2 + control flow since it requires updating the forward ops to output the needed + intermediates. We work around this by proactively outputting the needed + intermediates when building the forward pass itself. Ideally any such extra + tensors should be pruned out at runtime. However, if for any reason this + doesn't work for you or if you have an inference-only model you can turn this + behavior off using `tf.compat.v1.experimental.output_all_intermediates(False)`. If with the default behavior you are still seeing errors of the form diff --git a/tensorflow/python/ops/script_ops.py b/tensorflow/python/ops/script_ops.py index 6d689997679..d2620a94d62 100644 --- a/tensorflow/python/ops/script_ops.py +++ b/tensorflow/python/ops/script_ops.py @@ -331,9 +331,9 @@ def _internal_py_func(func, func = EagerFunc(func, Tout, is_grad_func) # Tying the registered function's lifetime with the current default graph is - # not reliable. For example, Estimator-based binaries may switch graphs in - # between model training end evaluation, via saved_model. Those binaries work - # because the original function is global, and break once the registered + # not reliable. For example, a binary may switch graphs in between model + # training end evaluation, via saved_model. Those binaries work because the + # original function is global, and break once the registered # function is an anonymous lambda, like the one produced by do_not_convert. # To avoid breaking those cases, we attach the wrapper to the original # function so that their lifetime is connected. diff --git a/tensorflow/python/ops/while_v2.py b/tensorflow/python/ops/while_v2.py index 637adc81f43..e535dea22ac 100644 --- a/tensorflow/python/ops/while_v2.py +++ b/tensorflow/python/ops/while_v2.py @@ -142,8 +142,6 @@ def while_loop(cond, return math_ops.logical_and( loop_counter < maximum_iterations_arg, pred) - # NOTE(skyewm): we set collections to the outer graph's collections for - # compatibility with TPUEstimator. cond_graph = func_graph_module.func_graph_from_py_func( cond_name, wrapped_cond, diff --git a/tensorflow/python/saved_model/load.py b/tensorflow/python/saved_model/load.py index 3e69e076230..aa4f18e8353 100644 --- a/tensorflow/python/saved_model/load.py +++ b/tensorflow/python/saved_model/load.py @@ -861,9 +861,8 @@ def load(export_dir, tags=None, options=None): _Importing SavedModels from TensorFlow 1.x_ - SavedModels from `tf.estimator.Estimator` or 1.x SavedModel APIs have a flat - graph instead of `tf.function` objects. These SavedModels will be loaded with - the following attributes: + 1.x SavedModels APIs have a flat graph instead of `tf.function` objects. + These SavedModels will be loaded with the following attributes: * `.signatures`: A dictionary mapping signature names to functions. * `.prune(feeds, fetches) `: A method which allows you to extract @@ -924,8 +923,7 @@ def load_partial(export_dir, filters, tags=None, options=None): `tf.saved_model.load(export_dir)` are equivalent. Note: This only works for SavedModels saved with TensorFlow V2 from - `tf.saved_model.save` or Keras. This will not load SavedModels save from - the Estimator API. + `tf.saved_model.save` or Keras. In Tensorflow V2, SavedModel stores the **object graph** of the saved object. The graph contains nodes (`tf.Module`, `tf.Variable`, `tf.function`, Keras @@ -1066,8 +1064,8 @@ def load_partial(export_dir, filters, tags=None, options=None): root.function_aliases = loader.function_aliases else: if filters: - raise ValueError("SavedModels saved from Tensorflow 1.x or Estimator (any" - " version) cannot be loaded with node filters.") + raise ValueError("SavedModels saved from Tensorflow 1.x) cannot be " + "loaded with node filters.") with ops.init_scope(): root = load_v1_in_v2.load( export_dir, tags, options.experimental_skip_checkpoint diff --git a/tensorflow/python/saved_model/loader_impl.py b/tensorflow/python/saved_model/loader_impl.py index 3b86b89013a..980340f1c67 100644 --- a/tensorflow/python/saved_model/loader_impl.py +++ b/tensorflow/python/saved_model/loader_impl.py @@ -182,8 +182,6 @@ def _get_main_op_tensor( RuntimeError: If the collection def corresponding to the main op key has other than exactly one tensor. """ - # TODO(kathywu): Rename this method to _get_op_from_collection when - # dependency from SavedModelEstimator is removed. collection_def = meta_graph_def_to_load.collection_def init_op = None if init_op_key in collection_def: diff --git a/tensorflow/python/saved_model/model_utils/__init__.py b/tensorflow/python/saved_model/model_utils/__init__.py index 1138410164b..d7bc1edc2b0 100644 --- a/tensorflow/python/saved_model/model_utils/__init__.py +++ b/tensorflow/python/saved_model/model_utils/__init__.py @@ -13,7 +13,7 @@ # limitations under the License. # ============================================================================== # LINT.IfChange -"""Utils for saving a Keras Model or Estimator to the SavedModel format.""" +"""Utils for saving a Keras Model to the SavedModel format.""" # pylint: disable=wildcard-import from tensorflow.python.saved_model.model_utils.export_output import * from tensorflow.python.saved_model.model_utils.export_utils import build_all_signature_defs diff --git a/tensorflow/python/saved_model/model_utils/export_utils.py b/tensorflow/python/saved_model/model_utils/export_utils.py index 06f8fa7890b..a9e486acd8b 100644 --- a/tensorflow/python/saved_model/model_utils/export_utils.py +++ b/tensorflow/python/saved_model/model_utils/export_utils.py @@ -323,7 +323,7 @@ def export_outputs_for_mode( metric_value must be a Tensor, and update_op must be a Tensor or Op Returns: - Dictionary mapping the a key to an `tf.estimator.export.ExportOutput` object + Dictionary mapping the key to an `ExportOutput` object. The key is the expected SignatureDef key for the mode. Raises: @@ -332,9 +332,7 @@ def export_outputs_for_mode( if mode not in SIGNATURE_KEY_MAP: raise ValueError( f'Export output type not found for `mode`: {mode}. Expected one of: ' - f'{list(SIGNATURE_KEY_MAP.keys())}.\n' - 'One likely error is that V1 Estimator Modekeys were somehow passed to ' - 'this function. Please ensure that you are using the new ModeKeys.') + f'{list(SIGNATURE_KEY_MAP.keys())}.') signature_key = SIGNATURE_KEY_MAP[mode] if mode_keys.is_predict(mode): return get_export_outputs(serving_export_outputs, predictions) diff --git a/tensorflow/python/saved_model/simple_save.py b/tensorflow/python/saved_model/simple_save.py index f84e80402e0..0dadbcb269f 100644 --- a/tensorflow/python/saved_model/simple_save.py +++ b/tensorflow/python/saved_model/simple_save.py @@ -45,10 +45,7 @@ def simple_save(session, export_dir, inputs, outputs, legacy_init_op=None): - The SavedModel will load in TensorFlow Serving and supports the [Predict API](https://github.com/tensorflow/serving/blob/master/tensorflow_serving/apis/predict.proto). - To use the Classify, Regress, or MultiInference APIs, please - use either - [tf.Estimator](https://www.tensorflow.org/api_docs/python/tf/estimator/Estimator) - or the lower level + To use the Classify, Regress, or MultiInference APIs, please see the [SavedModel APIs](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/README.md). - Some TensorFlow ops depend on information on disk or other information diff --git a/tensorflow/python/tools/api/generator/api_gen.bzl b/tensorflow/python/tools/api/generator/api_gen.bzl index 763a5f24158..c41aeecc476 100644 --- a/tensorflow/python/tools/api/generator/api_gen.bzl +++ b/tensorflow/python/tools/api/generator/api_gen.bzl @@ -1,9 +1,9 @@ """Targets for generating TensorFlow Python API __init__.py files.""" +load("//tensorflow:py.default.bzl", "py_binary") load("//tensorflow:tensorflow.bzl", "if_oss") load("//tensorflow:tensorflow.default.bzl", "if_indexing_source_code") load("//tensorflow/python/tools/api/generator:api_init_files.bzl", "TENSORFLOW_API_INIT_FILES") -load("//tensorflow:py.default.bzl", "py_binary") TENSORFLOW_API_GEN_PACKAGES = [ "tensorflow.python", @@ -98,7 +98,7 @@ def gen_api_init_files( srcs: genrule sources. If passing root_init_template, the template file must be included in sources. api_name: Name of the project that you want to generate API files for - (e.g. "tensorflow" or "estimator"). + (e.g. "tensorflow"). api_version: TensorFlow API version to generate. Must be either 1 or 2. compat_api_versions: Older TensorFlow API versions to generate under compat/ directory. diff --git a/tensorflow/python/tools/api/generator/create_python_api.py b/tensorflow/python/tools/api/generator/create_python_api.py index c856e8a6486..cd76ae73f77 100644 --- a/tensorflow/python/tools/api/generator/create_python_api.py +++ b/tensorflow/python/tools/api/generator/create_python_api.py @@ -410,7 +410,7 @@ def add_imports_for_symbol(module_code_builder, symbol: A symbol. source_module_name: Module that we can import the symbol from. source_name: Name we can import the symbol with. - api_name: API name. Currently, must be either `tensorflow` or `estimator`. + api_name: API name. Currently, must be `tensorflow`. api_version: API version. output_module_prefix: Prefix to prepend to destination module. """ @@ -458,7 +458,7 @@ def get_api_init_text(packages, tf_export decorators. output_package: Base output python package where generated API will be added. - api_name: API you want to generate (e.g. `tensorflow` or `estimator`). + api_name: API you want to generate Currently, only `tensorflow`. api_version: API version you want to generate (1 or 2). compat_api_versions: Additional API versions to generate under compat/ directory. @@ -552,7 +552,7 @@ def get_module_docstring(module_name, package, api_name): prefix) to get a docstring for. package: Base python package containing python with target tf_export decorators. - api_name: API you want to generate (e.g. `tensorflow` or `estimator`). + api_name: API you want to generate Currently, only `tensorflow`. Returns: One-line docstring to describe the module. @@ -609,7 +609,7 @@ def create_primary_api_files(output_files, PLACEHOLDER" comment in the template file will be replaced with imports. output_dir: output API root directory. output_package: Base output package where generated API will be added. - api_name: API you want to generate (e.g. `tensorflow` or `estimator`). + api_name: API you want to generate Currently, only `tensorflow`. api_version: API version to generate (`v1` or `v2`). compat_api_versions: Additional API versions to generate in compat/ subdirectory. @@ -695,9 +695,7 @@ def create_primary_api_files(output_files, f'Missing outputs for genrule:\n{missing_files}. Be sure to add these ' 'targets to tensorflow/python/tools/api/generator/api_init_files_v1.bzl' ' and tensorflow/python/tools/api/generator/api_init_files.bzl ' - '(tensorflow repo), tf_keras/api/api_init_files.bzl (tf_keras repo), ' - 'or tensorflow_estimator/python/estimator/api/api_gen.bzl (estimator ' - 'repo)') + '(tensorflow repo), or tf_keras/api/api_init_files.bzl (tf_keras repo)') def create_proxy_api_files(output_files, diff --git a/tensorflow/python/tools/api/generator/doc_srcs.py b/tensorflow/python/tools/api/generator/doc_srcs.py index 56ab8a1b221..0de3048a7f0 100644 --- a/tensorflow/python/tools/api/generator/doc_srcs.py +++ b/tensorflow/python/tools/api/generator/doc_srcs.py @@ -139,8 +139,6 @@ def get_doc_sources(api_name): """ if api_name == tf_export.TENSORFLOW_API_NAME: return _TENSORFLOW_DOC_SOURCES - if api_name == tf_export.ESTIMATOR_API_NAME: - return _ESTIMATOR_DOC_SOURCES if api_name == tf_export.KERAS_API_NAME: return _KERAS_DOC_SOURCES return {} diff --git a/tensorflow/python/tools/api/generator/doc_srcs_test.py b/tensorflow/python/tools/api/generator/doc_srcs_test.py index 9048dc739df..9b62a9b251e 100644 --- a/tensorflow/python/tools/api/generator/doc_srcs_test.py +++ b/tensorflow/python/tools/api/generator/doc_srcs_test.py @@ -69,7 +69,7 @@ if __name__ == '__main__': 'decorators.') parser.add_argument( '--api_name', type=str, - help='API name: tensorflow or estimator') + help='API name: tensorflow') FLAGS, unparsed = parser.parse_known_args() importlib.import_module(FLAGS.package) diff --git a/tensorflow/python/tools/api/generator2/apis.bzl b/tensorflow/python/tools/api/generator2/apis.bzl index 28506ff9856..6db77d70134 100644 --- a/tensorflow/python/tools/api/generator2/apis.bzl +++ b/tensorflow/python/tools/api/generator2/apis.bzl @@ -29,10 +29,4 @@ APIS = { "//tensorflow/compiler/mlir/quantization/tensorflow/python:all", ]), }, - "tensorflow_estimator": { - "decorator": "tensorflow_estimator.python.estimator.estimator_export.estimator_export", - "target_patterns": compile_patterns([ - "//tensorflow_estimator/...", - ]), - }, } diff --git a/tensorflow/python/tools/api/generator2/extractor/extractor_test.py b/tensorflow/python/tools/api/generator2/extractor/extractor_test.py index 36fb1f21524..c57d1d5a1a1 100644 --- a/tensorflow/python/tools/api/generator2/extractor/extractor_test.py +++ b/tensorflow/python/tools/api/generator2/extractor/extractor_test.py @@ -32,14 +32,6 @@ class ParserTest(absltest.TestCase): '''# 1 """this is an exported docstring. API docstring: tf.test -""" # 4 - ''', - ) - p.process( - 'test2.py', - '''# 1 -"""this is not an exported docstring. -API docstring: tf_estimator.test2 """ # 4 ''', ) diff --git a/tensorflow/python/tools/module_util.py b/tensorflow/python/tools/module_util.py index 2b6e9007dc6..80e2b3df3d5 100644 --- a/tensorflow/python/tools/module_util.py +++ b/tensorflow/python/tools/module_util.py @@ -26,13 +26,12 @@ def get_parent_dir_for_name(module_name): """Get parent directory for module with the given name. Args: - module_name: Module name for e.g. - tensorflow_estimator.python.estimator.api._v1.estimator. + module_name: Module name, e.g. tf_keras.api._v2.keras. Returns: Path to the parent directory if module is found and None otherwise. Given example above, it should return: - /pathtoestimator/tensorflow_estimator/python/estimator/api/_v1. + /root_path/tf_keras/api/_v2. """ name_split = module_name.split(".") if not name_split: diff --git a/tensorflow/python/tpu/BUILD b/tensorflow/python/tpu/BUILD index 9d296a0f953..e9a299b3886 100644 --- a/tensorflow/python/tpu/BUILD +++ b/tensorflow/python/tpu/BUILD @@ -97,6 +97,7 @@ tpu_py_strict_test( srcs = ["async_checkpoint_test.py"], disable_experimental = True, disable_mlir_bridge = False, + tags = ["no_oss"], deps = [ ":async_checkpoint", ":tpu_lib", @@ -208,7 +209,6 @@ py_strict_library( srcs_version = "PY3", deps = [ ":feature_column_v2", - ":tpu_embedding", ":tpu_embedding_for_serving", ":tpu_embedding_v1", ":tpu_embedding_v2", @@ -291,7 +291,6 @@ pytype_strict_library( srcs = [ "__init__.py", "bfloat16.py", - "session_support.py", "tpu_optimizer.py", "tpu_strategy_util.py", "training_loop.py", @@ -548,33 +547,6 @@ tf_py_strict_test( ], ) -pytype_strict_library( - name = "tpu_embedding", - srcs = [ - "tpu_embedding.py", - "tpu_embedding_gradient.py", - ], - srcs_version = "PY3", - deps = [ - ":tpu_system_metadata", - "//tensorflow/core/protobuf/tpu:optimization_parameters_proto_py", - "//tensorflow/core/protobuf/tpu:tpu_embedding_configuration_proto_py", - "//tensorflow/python/eager:context", - "//tensorflow/python/framework:for_generated_wrappers", - "//tensorflow/python/ops:array_ops", - "//tensorflow/python/ops:control_flow_ops", - "//tensorflow/python/ops:init_ops", - "//tensorflow/python/ops:math_ops", - "//tensorflow/python/ops:partitioned_variables", - "//tensorflow/python/ops:state_ops", - "//tensorflow/python/ops:variable_scope", - "//tensorflow/python/ops:variables", - "//tensorflow/python/platform:tf_logging", - "//tensorflow/python/tpu/ops", - "//tensorflow/python/util:tf_export", - ], -) - pytype_strict_library( name = "tpu_strategy_util", srcs = ["tpu_strategy_util.py"], diff --git a/tensorflow/python/tpu/api.py b/tensorflow/python/tpu/api.py index fb4c10a594d..ee7d486db7e 100644 --- a/tensorflow/python/tpu/api.py +++ b/tensorflow/python/tpu/api.py @@ -22,7 +22,7 @@ for tf_export decorations. from tensorflow.python.tpu import bfloat16 from tensorflow.python.tpu import feature_column_v2 from tensorflow.python.tpu import tpu -from tensorflow.python.tpu import tpu_embedding + from tensorflow.python.tpu import tpu_embedding_for_serving from tensorflow.python.tpu import tpu_embedding_v1 from tensorflow.python.tpu import tpu_embedding_v2 diff --git a/tensorflow/python/tpu/feature_column.py b/tensorflow/python/tpu/feature_column.py index 2dffcebf24e..adf3dd80f59 100644 --- a/tensorflow/python/tpu/feature_column.py +++ b/tensorflow/python/tpu/feature_column.py @@ -688,38 +688,3 @@ def get_sequence_length_feature_key_name_from_feature_key_name(feature_name): A string which is the feature key for the associated feature length column. """ return feature_name + _SEQUENCE_FEATURE_LENGTH_POSTFIX - - -def split_sequence_columns(feature_columns): - """Split a list of _TPUEmbeddingColumn into sequence and non-sequence columns. - - For use in a TPUEstimator model_fn function. E.g. - - def model_fn(features): - sequence_columns, feature_columns = ( - tf.tpu.feature_column.split_sequence_columns(feature_columns)) - input = tf.feature_column.input_layer( - features=features, feature_columns=feature_columns) - sequence_features, sequence_lengths = ( - tf.contrib.feature_column.sequence_input_layer( - features=features, feature_columns=sequence_columns)) - - Args: - feature_columns: A list of _TPUEmbeddingColumns to split. - - Returns: - Two lists of _TPUEmbeddingColumns, the first is the sequence columns and the - second is the non-sequence columns. - """ - sequence_columns = [] - non_sequence_columns = [] - for column in feature_columns: - if not isinstance(column, (_TPUEmbeddingColumn, _TPUSharedEmbeddingColumn)): - raise TypeError( - 'column must be a _TPUEmbeddingColumn or _TPUSharedEmbeddingColumn ' - f'but got {type(column)} instead.') - if column.is_sequence_column(): - sequence_columns.append(column) - else: - non_sequence_columns.append(column) - return sequence_columns, non_sequence_columns diff --git a/tensorflow/python/tpu/ops/tpu_ops.py b/tensorflow/python/tpu/ops/tpu_ops.py index d54cb5a68af..a8c709b7eab 100644 --- a/tensorflow/python/tpu/ops/tpu_ops.py +++ b/tensorflow/python/tpu/ops/tpu_ops.py @@ -170,11 +170,7 @@ def _embedding_activations_grad(activations_op, grad_wrt_activations): raise RuntimeError( "Gradients for TPUEmbedding have been generated in non-training mode." "This is not expected. Consider putting your Optimizer.minimize code " - "behind the training mode condition check. For Estimator, you can " - "do \n\n" - " if mode == tf.estimator.ModeKeys.TRAIN:\n" - " train_op = opt.minimize(loss)\n" - "\n") + "behind the training mode condition check\n") if lookup_id < 0 or lookup_id >= len(table_gradients): raise RuntimeError( diff --git a/tensorflow/python/tpu/session_support.py b/tensorflow/python/tpu/session_support.py deleted file mode 100644 index 0c2a337a2a6..00000000000 --- a/tensorflow/python/tpu/session_support.py +++ /dev/null @@ -1,448 +0,0 @@ -# Copyright 2017 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the 'License'); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an 'AS IS' BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ====================================== -"""Operations for handling session logging and shutdown notifications.""" - -import threading - -import time -from google.protobuf import text_format - -from tensorflow.core.protobuf import config_pb2 -from tensorflow.core.util import event_pb2 -from tensorflow.python.client import session as session_lib -from tensorflow.python.framework import dtypes -from tensorflow.python.framework import errors -from tensorflow.python.framework import ops -from tensorflow.python.ops import array_ops -from tensorflow.python.platform import tf_logging as logging -from tensorflow.python.tpu.ops import tpu_ops -from tensorflow.python.training import session_run_hook -from tensorflow.python.training import training_util - -_WATCHDOG = None - - -class CoordinatorResetError(errors.AbortedError): - """Raised when the monitored session should reset.""" - - def __init__(self): - errors.AbortedError.__init__( - self, None, None, 'Resetting session loop due to worker shutdown.') - - -def _clone_session(session, graph=None): - return session_lib.Session( - target=session.sess_str, - config=session._config, # pylint: disable=protected-access - graph=graph if graph else session.graph) - - -class WorkerHeartbeatManager(object): - """Manages the status/heartbeat monitor for a set of workers.""" - - def __init__(self, session, devices, heartbeat_ops, request_placeholder): - """Construct a new WorkerHeartbeatManager. - - (Prefer using `WorkerHeartbeatManager.from_devices` when possible.) - - Args: - session: `tf.compat.v1.Session`, session to use for heartbeat operations. - devices: `list[string]` Set of devices to connect to. - heartbeat_ops: `list[tf.Operation]` Heartbeat operations. - request_placeholder: `tf.Placeholder[String]` Placeholder used to specify - the WorkerHeartbeatRequest protocol buffer. - """ - self._session = session - self._devices = devices - self._ops = heartbeat_ops - self._request_placeholder = request_placeholder - - @staticmethod - def from_devices(session, devices): - """Construct a heartbeat manager for the given devices.""" - if not devices: - logging.error('Trying to create heartbeat manager with no devices?') - - logging.info('Creating heartbeat manager for %s', devices) - request_placeholder = array_ops.placeholder( - name='worker_heartbeat_request', dtype=dtypes.string) - - heartbeat_ops = [] - for device in devices: - with ops.device(device): - heartbeat_ops.append(tpu_ops.worker_heartbeat(request_placeholder)) - - return WorkerHeartbeatManager(session, devices, heartbeat_ops, - request_placeholder) - - def num_workers(self): - return len(self._devices) - - def configure(self, message): - """Configure heartbeat manager for all devices. - - Args: - message: `event_pb2.WorkerHeartbeatRequest` - Returns: `None` - """ - logging.info('Configuring worker heartbeat: %s', - text_format.MessageToString(message)) - self._session.run(self._ops, - {self._request_placeholder: message.SerializeToString()}) - - def ping(self, request=None, timeout_in_ms=60000): - """Ping all workers, returning the parsed status results.""" - if request is None: - request = event_pb2.WorkerHeartbeatRequest() - - options = config_pb2.RunOptions(timeout_in_ms=timeout_in_ms) - results = self._session.run( - self._ops, - feed_dict={self._request_placeholder: request.SerializeToString()}, - options=options) - parsed_results = [ - event_pb2.WorkerHeartbeatResponse.FromString(res_pb) - for res_pb in results - ] - logging.debug('Ping results: %s', parsed_results) - return parsed_results - - def lame_workers(self): - """Ping all workers, returning manager containing lame workers (or None).""" - ping_results = self.ping() - lame_workers = [] - - for ping_response, device, op in zip(ping_results, self._devices, - self._ops): - if ping_response.health_status != event_pb2.OK: - lame_workers.append((device, op)) - - if not lame_workers: - return None - - bad_devices, bad_ops = zip(*lame_workers) - return WorkerHeartbeatManager(self._session, bad_devices, bad_ops, - self._request_placeholder) - - def __repr__(self): - return 'HeartbeatManager(%s)' % ','.join(self._devices) - - # Default timeout is set to allow other shutdown triggered operations (log - # flushing etc) to finish before terminating the worker. - def shutdown(self, wait_time_in_ms=60000, exit_code=0): - """Shutdown all workers after `shutdown_timeout_secs`.""" - logging.info('Shutting down %s.', self) - req = event_pb2.WorkerHeartbeatRequest( - watchdog_config=event_pb2.WatchdogConfig(timeout_ms=wait_time_in_ms), - shutdown_mode=event_pb2.SHUTDOWN_AFTER_TIMEOUT, - exit_code=event_pb2.RequestedExitCode(exit_code=exit_code)) - self.configure(req) - - # Wait for workers to shutdown. - sleep_sec = 10.0 + wait_time_in_ms / 1000 - logging.info('Waiting %.2f seconds for worker shutdown.', sleep_sec) - time.sleep(sleep_sec) - - -def all_worker_devices(session): - """Return a list of devices for each worker in the system.""" - devices = session.list_devices() - - devices_that_support_heartbeats = [] - - for device in devices: - name = device.name - # Pick devices that have a TPU but target the attached CPU - if ':TPU:0' in name and 'coordinator' not in name: - devices_that_support_heartbeats.append(name.replace('TPU', 'CPU')) - - return devices_that_support_heartbeats - - -class WatchdogManager(threading.Thread): - """Configures worker watchdog timer and handles periodic pings. - - Usage: - # Ping workers every minute, shutting down workers if they haven't received - # a ping after 1 hour. - watchdog_manager = WatchdogManager( - ping_interval=60, shutdown_timeout=3600 - ) - - # Use as a context manager, resetting watchdog on context exit: - with watchdog_manager: - session.run(...) - - # Or setup globally; watchdog will remain active until program exit. - watchdog_manager.configure_and_run() - """ - - def __init__(self, - session, - devices=None, - ping_interval=60, - shutdown_timeout=2 * 3600): - """Initialize a watchdog manager. - - Args: - session: Session connected to worker devices. A cloned session and graph - will be created for managing worker pings. - devices: Set of devices to monitor. If none, all workers will be - monitored. - ping_interval: Time, in seconds, between watchdog pings. - shutdown_timeout: Time, in seconds, before watchdog timeout. - """ - threading.Thread.__init__(self) - self.ping_interval = ping_interval - self.shutdown_timeout = shutdown_timeout - self.daemon = True - self._config = session._config # pylint: disable=protected-access - self._target = session.sess_str - self._running = False - self._devices = devices - - self._graph = None - self._session = None - self._worker_manager = None - - def _reset_manager(self, stopping=False): - """Reset the graph, session and worker manager.""" - self._graph = ops.Graph() - self._session = session_lib.Session( - target=self._target, - graph=self._graph, - config=self._config, - ) - - if self._devices is None: - self._devices = all_worker_devices(self._session) - - with self._graph.as_default(): - self._worker_manager = WorkerHeartbeatManager.from_devices( - self._session, self._devices) - - if stopping: - timeout_ms = -1 - shutdown_mode = event_pb2.NOT_CONFIGURED - else: - timeout_ms = self.shutdown_timeout * 1000 - shutdown_mode = event_pb2.WAIT_FOR_COORDINATOR - - self._worker_manager.configure( - event_pb2.WorkerHeartbeatRequest( - watchdog_config=event_pb2.WatchdogConfig(timeout_ms=timeout_ms), - shutdown_mode=shutdown_mode)) - - def configure_and_run(self): - logging.info( - 'Enabling watchdog timer with %d second timeout ' - 'and %d second ping interval.', self.shutdown_timeout, - self.ping_interval) - self._reset_manager() - self._running = True - self.start() - - def stop(self): - logging.info('Stopping worker watchdog.') - self._reset_manager(stopping=True) - self._running = False - self.join() - - def __enter__(self): - self.configure_and_run() - - def __exit__(self, exc_type, exc_val, exc_tb): - self.stop() - - def run(self): - # Don't fetch logs or adjust timing: just ping the watchdog. - # - # If we hit an exception, reset our session as it is likely broken. - while self._running: - try: - self._worker_manager.ping(request=None) # pytype: disable=attribute-error - time.sleep(self.ping_interval) - except errors.OpError as e: - # Catch any TF errors that occur so we don't stop sending heartbeats - logging.debug('Caught error while sending heartbeat: %s', e) - self._reset_manager() - - -def start_worker_watchdog(session, - devices=None, - ping_interval=60, - shutdown_timeout=3600): - """Start global worker watchdog to shutdown workers on coordinator exit.""" - global _WATCHDOG - if _WATCHDOG is None: - # Ensure we can send a few pings before we timeout! - ping_interval = min(shutdown_timeout / 10., ping_interval) - _WATCHDOG = WatchdogManager(session, devices, ping_interval, - shutdown_timeout) - _WATCHDOG.configure_and_run() - - -def stop_worker_watchdog(): - """Stop global worker watchdog.""" - global _WATCHDOG - if _WATCHDOG is not None: - _WATCHDOG.stop() - _WATCHDOG = None - - -class GracefulShutdownHook(session_run_hook.SessionRunHook): - """Session hook that watches for shutdown events. - - If a shutdown is indicated, `saver.save(checkpoint_prefix)` is executed, and a - SystemShutdown exception is raised to terminate the main session. If `saver` - is None the `SAVERS` collection will be read to find a saver. - - `on_shutdown_hooks` is an optional list of functions that should be called - after checkpointing. The function is called with (`run_context`, - `all_workers`, `lame_workers`). - - If `heartbeat_group` is not specified, it will default to all CPU workers - in the system. - """ - - def __init__(self, checkpoint_prefix, saver=None, on_shutdown_hooks=None): - self._saver = saver - self._checkpoint_prefix = checkpoint_prefix - self._on_shutdown_hooks = on_shutdown_hooks if on_shutdown_hooks else [] - - # Worker heartbeats are managed independently of the main training graph. - self._graph = ops.Graph() - self._workers = None - self._session = None - self._heartbeat_supported = False - - def after_create_session(self, training_session, coord): # pylint: disable=unused-argument - # N.B. We have to pull the global step here to avoid it being unavailable - # at checkpoint time; the graph has been frozen at that point. - if training_util.get_global_step() is None and self.saver() is not None: - raise ValueError( - 'Saver defined but no global step. Run `get_or_create_global_step()`' - ' in your model definition to allow checkpointing.') - - with self._graph.as_default(): - logging.info('Installing graceful shutdown hook.') - self._session = _clone_session(training_session, self._graph) - self._workers = WorkerHeartbeatManager.from_devices( - self._session, all_worker_devices(self._session)) - self._heartbeat_supported = self._workers.num_workers() > 0 - if self._heartbeat_supported: - try: - self._workers.configure( - event_pb2.WorkerHeartbeatRequest( - shutdown_mode=event_pb2.WAIT_FOR_COORDINATOR)) - except errors.InvalidArgumentError: - logging.warn( - 'TPU device does not support heartbeats. Failure ' - 'handling will be disabled.') - self._heartbeat_supported = False - else: - logging.warn( - 'No workers support heartbeats. Failure handling will be disabled.') - - def saver(self): - if self._saver: - return self._saver - - savers = ops.get_collection(ops.GraphKeys.SAVERS) - if not savers: - return None - - if not isinstance(savers, list): - return savers - - if len(savers) > 1: - logging.error( - 'Multiple savers in the SAVERS collection. On-demand checkpointing ' - 'will be disabled. Pass an explicit `saver` to the constructor to ' - 'override this behavior.') - return None - - return savers[0] - - def after_run(self, run_context, run_values): - del run_values - if not self._heartbeat_supported: - return - - lame_workers = self._workers.lame_workers() - - if lame_workers: - logging.info('ShutdownHook: lame workers found: %s', lame_workers) - - if self.saver(): - logging.info('ShutdownHook: saving checkpoint to %s', - self._checkpoint_prefix) - self.saver().save( - run_context.session, - self._checkpoint_prefix, - global_step=training_util.get_global_step(), - write_state=True, - ) - else: - logging.info('ShutdownHook: no Saver defined.') - - for fn in self._on_shutdown_hooks: - fn(run_context, self._workers, lame_workers) - - -class ResetComputation(object): - """Hook to reset a TPUEstimator computation loop. - - This hook shuts down all workers and resets the monitored session loop by - throwing a CoordinatorResetError. - """ - - def __init__(self): - pass - - def __call__(self, run_context, all_workers, lame_workers): - del run_context, lame_workers - all_workers.shutdown(exit_code=42) - - logging.info('Resetting coordinator.') - raise CoordinatorResetError() - - -class ShutdownLameWorkers(object): - """Shutdown lamed workers. - - Processing will continue normally (typically by waiting for the down - workers to be restarted). - """ - - def __init__(self): - pass - - def __call__(self, run_context, all_workers, lame_workers): - lame_workers.shutdown(exit_code=42) - - -class ShutdownAllWorkers(object): - """Shutdown all workers. - - Processing will continue normally (typically by waiting for the down - workers to be restarted). - """ - - def __init__(self): - pass - - def __call__(self, run_context, all_workers, lame_workers): - all_workers.shutdown(exit_code=42) diff --git a/tensorflow/python/tpu/tests/BUILD b/tensorflow/python/tpu/tests/BUILD index b863f08b9c3..2def8f441f5 100644 --- a/tensorflow/python/tpu/tests/BUILD +++ b/tensorflow/python/tpu/tests/BUILD @@ -68,37 +68,6 @@ tpu_py_strict_test( ], ) -tpu_py_strict_test( - name = "tpu_embedding_v2_optimizer_test", - srcs = [ - "tpu_embedding_v2_optimizer_test.py", - ], - disable_experimental = True, - disable_mlir_bridge = False, - python_version = "PY3", - srcs_version = "PY3", - deps = [ - ":tpu_embedding_base_test", - "//tensorflow/python/compat:v2_compat", - "//tensorflow/python/data/ops:dataset_ops", - "//tensorflow/python/distribute:distribute_lib", - "//tensorflow/python/eager:backprop", - "//tensorflow/python/eager:def_function", - "//tensorflow/python/framework:constant_op", - "//tensorflow/python/framework:dtypes", - "//tensorflow/python/ops:init_ops_v2", - "//tensorflow/python/ops:math_ops", - "//tensorflow/python/ops:math_ops_gen", - "//tensorflow/python/ops:variables", - "//tensorflow/python/platform:client_testlib", - "//tensorflow/python/tpu:tpu_embedding", - "//tensorflow/python/tpu:tpu_embedding_v2", - "//tensorflow/python/tpu:tpu_embedding_v2_utils", - "//third_party/py/numpy", - "@absl_py//absl/testing:parameterized", - ], -) - tpu_py_strict_test( name = "tpu_embedding_v2_mp_strategy_test", srcs = [ diff --git a/tensorflow/python/tpu/tests/tpu_embedding_v2_optimizer_test.py b/tensorflow/python/tpu/tests/tpu_embedding_v2_optimizer_test.py deleted file mode 100644 index 3f658f0696d..00000000000 --- a/tensorflow/python/tpu/tests/tpu_embedding_v2_optimizer_test.py +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 2020 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""Tests for TPU Embeddings mid level API on TPU.""" -import functools -from absl.testing import parameterized -import numpy as np - -from tensorflow.python.compat import v2_compat -from tensorflow.python.data.ops import dataset_ops -from tensorflow.python.distribute import distribute_lib -from tensorflow.python.eager import backprop -from tensorflow.python.eager import def_function -from tensorflow.python.framework import constant_op -from tensorflow.python.framework import dtypes -from tensorflow.python.ops import gen_math_ops -from tensorflow.python.ops import init_ops_v2 -from tensorflow.python.ops import math_ops -from tensorflow.python.ops import variables as tf_variables -from tensorflow.python.platform import test -from tensorflow.python.tpu import tpu_embedding -from tensorflow.python.tpu import tpu_embedding_v2 -from tensorflow.python.tpu import tpu_embedding_v2_utils -from tensorflow.python.tpu.tests import tpu_embedding_base_test - - -class TPUEmbeddingTest(tpu_embedding_base_test.TPUEmbeddingBaseTest): - - def test_unsupported_optimizer(self): - with self.assertRaisesRegex( - ValueError, 'is an unsupported optimizer class.'): - with self._get_strategy().scope(): - tpu_embedding_v2.TPUEmbedding( - self.feature_config, - tpu_embedding.AdagradParameters(learning_rate=0.1)) - - def test_variable_learning_rate(self): - num_steps = 10 - num_steps_float = float(num_steps) - starting_lr = 1.0 - ending_lr = 0.5 - - strategy = self._get_strategy() - num_replicas = strategy.num_replicas_in_sync - - # Create model with Keras. - with strategy.scope(): - step_counter = tf_variables.Variable(0.0, dtypes.float32) - - def lr_function(): - return gen_math_ops.maximum( - ending_lr, - starting_lr + ((ending_lr - starting_lr) * step_counter) / - num_steps_float) - - optimizer = tpu_embedding_v2_utils.SGD(learning_rate=lr_function) - table_config = tpu_embedding_v2_utils.TableConfig( - vocabulary_size=num_replicas, - dim=4, - initializer=init_ops_v2.Constant(np.zeros((num_replicas, 4))), - combiner='sum', name='table') - mid_level_api = tpu_embedding_v2.TPUEmbedding( - feature_config={ - 'feature': tpu_embedding_v2_utils.FeatureConfig( - table=table_config, name='feature')}, - optimizer=optimizer) - - feature = { - 'feature': constant_op.constant([0], shape=(1, 1), dtype=dtypes.int32) - } - - def input_fn(ctx): - del ctx - return dataset_ops.DatasetV2.from_tensors(feature).repeat() - - dist = strategy.distribute_datasets_from_function( - input_fn, - options=distribute_lib.InputOptions(experimental_fetch_to_device=False)) - dist_iter = iter(dist) - - @def_function.function - def test_fn(): - def step(): - with backprop.GradientTape() as tape: - activations = mid_level_api.dequeue() - tape.watch(activations) - result = math_ops.reduce_sum(activations['feature']) - loss = result / num_replicas - grads = tape.gradient(loss, activations) - mid_level_api.apply_gradients(grads) - return activations['feature'] - - mid_level_api.enqueue(next(dist_iter), training=True) - return strategy.run(step) - - # Run model. - results = [] - for _ in range(num_steps): - result = test_fn() - results.append(self._unpack(strategy, result)) - step_counter.assign_add(1.0) - - # Table is 2 elements wide, per-replica batch size of 1, with id 0. - # Loss for the gradient is the sum of the entries divided by the number of - # replicas. Thus the per replica gradient is 1/#of replicas for row 0 and no - # other updates. The reduced gradient is therefore 1. - # Learning rate schedule over num_steps steps: - # 1.0 0.95 0.9 0.85 0.8 ... - # Since use SGD and the gradient is one, the first row of the table is - # [0, 0] [-1.0, -1.0] [-1.95, -1.95] [-2.85, -2.85] ... (the negative - # partial sums of the above). - - learning_rates = [starting_lr - (starting_lr - ending_lr) / num_steps * j - for j in range(num_steps)] - cumsum = [sum(learning_rates[0:j]) for j in range(num_steps)] - goldens = [[[-cumsum[i]] * table_config.dim] * num_replicas - for i in range(10)] - self.assertAllClose(results, goldens) - - @parameterized.parameters([True, False]) - def test_optimizer_with_slot_creation_fn(self, use_tpu): - def slot_creation_fn(table, slot_names, _): - slots = {} - for slot in slot_names: - slots[slot] = tf_variables.Variable( - name='{}_{}'.format(table.name, slot), - initial_value=functools.partial( - init_ops_v2.Zeros(), shape=table.shape, dtype=dtypes.float32), - trainable=False) - return slots - optimizer = tpu_embedding_v2_utils.Adagrad( - learning_rate=0.1, - slot_variable_creation_fn=slot_creation_fn) - if use_tpu: - strategy = self._get_strategy() - else: - strategy = distribute_lib.get_strategy() - with strategy.scope(): - mid_level = tpu_embedding_v2.TPUEmbedding( - feature_config=self.feature_config, - optimizer=optimizer) - # We aren't going to actually run anything, so the batch_size here does - # not matter. - mid_level.build(self.batch_size) - video_accumulator = mid_level._variables['video']['accumulators'] - user_accumulator = mid_level._variables['user']['accumulators'] - if use_tpu: - # To check the table contents (ensure that it is zero rather than the - # normal initial accumulator value specified to in the optimizer config), - # we need to select the underlying table variable on TPU. - # We only have one shard on Forge. - video_accumulator = video_accumulator.variables[0] - user_accumulator = user_accumulator.variables[0] - - self.assertAllClose(video_accumulator.numpy(), - np.zeros((self.table_video.vocabulary_size, - self.table_video.dim))) - self.assertAllClose(user_accumulator.numpy(), - np.zeros((self.table_user.vocabulary_size, - self.table_user.dim))) - - def test_optimizer_with_slot_creation_fn_non_partial(self): - def slot_creation_fn(table, slot_names, _): - slots = {} - for slot in slot_names: - # Note that we don't pass functools.partial here, so on TPU we can't - # extract the shape. We expect the error below. - slots[slot] = tf_variables.Variable( - name='{}_{}'.format(table.name, slot), - initial_value=init_ops_v2.Zeros()(shape=table.shape, - dtype=dtypes.float32), - trainable=False) - return slots - optimizer = tpu_embedding_v2_utils.Adagrad( - learning_rate=0.1, - slot_variable_creation_fn=slot_creation_fn) - strategy = self._get_strategy() - with strategy.scope(): - mid_level_api = tpu_embedding_v2.TPUEmbedding( - feature_config=self.feature_config, - optimizer=optimizer) - with self.assertRaisesRegex(ValueError, - 'Unable to extract initializer function'): - # We aren't going to actually run anything, so the batch_size here does - # not matter. - mid_level_api.build(self.batch_size) - -if __name__ == '__main__': - v2_compat.enable_v2_behavior() - test.main() diff --git a/tensorflow/python/tpu/tpu_embedding.py b/tensorflow/python/tpu/tpu_embedding.py deleted file mode 100644 index 1ef23a0b624..00000000000 --- a/tensorflow/python/tpu/tpu_embedding.py +++ /dev/null @@ -1,3025 +0,0 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""TPU embedding APIs.""" - -import collections -import copy -import math -import re -from typing import Optional - -from tensorflow.core.protobuf.tpu import optimization_parameters_pb2 -from tensorflow.core.protobuf.tpu import tpu_embedding_configuration_pb2 as elc -from tensorflow.python.eager import context -from tensorflow.python.framework import dtypes -from tensorflow.python.framework import ops -from tensorflow.python.ops import array_ops -from tensorflow.python.ops import control_flow_ops -from tensorflow.python.ops import init_ops -from tensorflow.python.ops import math_ops -from tensorflow.python.ops import partitioned_variables -from tensorflow.python.ops import state_ops -from tensorflow.python.ops import variable_scope -from tensorflow.python.platform import tf_logging as logging -from tensorflow.python.tpu import tpu_system_metadata as tpu_system_metadata_lib -from tensorflow.python.tpu.ops import tpu_ops -from tensorflow.python.util.tf_export import tf_export - -TRAINING = elc.TPUEmbeddingConfiguration.TRAINING -INFERENCE = elc.TPUEmbeddingConfiguration.INFERENCE - - -# TODO(shizhiw): a more future-proof way is to have optimization_parameter such -# as AdagradParameters etc instead of learning_rate. -class TableConfig( - collections.namedtuple('TableConfig', [ - 'vocabulary_size', - 'dimension', - 'initializer', - 'combiner', - 'hot_id_replication', - 'learning_rate', - 'learning_rate_fn', - 'optimization_parameters', - ])): - """Embedding table configuration.""" - - def __new__(cls, - vocabulary_size, - dimension, - initializer=None, - combiner='mean', - hot_id_replication=False, - learning_rate=None, - learning_rate_fn=None, - optimization_parameters=None): - """Embedding table configuration. - - Args: - vocabulary_size: Number of vocabulary (/rows) in the table. - dimension: The embedding dimension. - initializer: A variable initializer function to be used in embedding - variable initialization. If not specified, defaults to - `tf.compat.v1.truncated_normal_initializer` with mean `0.0` and standard - deviation `1/sqrt(dimension)`. - combiner: A string specifying how to reduce if there are multiple entries - in a single row. Currently 'mean', 'sqrtn', 'sum' and None are - supported, with 'mean' the default. 'sqrtn' often achieves good - accuracy, in particular with bag-of-words columns. For more information, - see `tf.nn.embedding_lookup_sparse`. None is only valid for dense rather - than sparse tensors. - hot_id_replication: If true, enables hot id replication, which can make - embedding lookups faster if there are some hot rows in the table. - learning_rate: float, static learning rate for this table. If - learning_rate and learning_rate_fn are both `None`, static learning rate - as specified in local `optimization_parameters` will be used. In case - local `optimization_parameters` is `None`, global - `optimization_parameters` in `TPUEmbedding` constructor will be used. - `learning_rate_fn` must be `None` if `learning_rate` is not `None. - learning_rate_fn: string, use dynamic learning rate given by the function. - This function will be passed the current global step. If learning_rate - and learning_rate_fn are both `None`, static learning rate as specified - in `optimization_parameters` is used. `learning_rate` must be `None` if - `learning_rate_fn` is not `None. - optimization_parameters: `AdagradParameters`, `AdamParameters`, - `Stochasticgradientdescentparameters`. Specifies table level optimizer. - If it's `None` global optimizer in `TPUEmbedding` constructor is used. - - Returns: - `TableConfig`. - - Raises: - ValueError: if `vocabulary_size` is not positive integer. - ValueError: if `dimension` is not positive integer. - ValueError: if `initializer` is specified and is not callable. - ValueError: if `combiner` is not supported. - ValueError: if `learning_rate` and `learning_rate_fn` are both not - `None`. - """ - if not isinstance(vocabulary_size, int) or vocabulary_size < 1: - raise ValueError(f'vocabulary_size must >= 1. ' - f'Received: {vocabulary_size}.') - - if not isinstance(dimension, int) or dimension < 1: - raise ValueError( - f'dimension must be a positive int. Received: {dimension}.') - - if (initializer is not None) and (not callable(initializer)): - raise ValueError(f'initializer must be callable if specified. ' - f'Received: {initializer}.') - if initializer is None: - initializer = init_ops.truncated_normal_initializer( - mean=0.0, stddev=1 / math.sqrt(dimension)) - - if combiner not in ('mean', 'sum', 'sqrtn', None): - raise ValueError(f'combiner must be "mean", "sum", "sqrtn" or None. ' - f'Received: {combiner}.') - - if learning_rate is not None and learning_rate_fn is not None: - raise ValueError('At most one of learning_rate and learning_rate_fn ' - 'can be None. Received: {} and {}'.format( - learning_rate, learning_rate_fn)) - - if optimization_parameters is not None: - if not isinstance(optimization_parameters, _OptimizationParameters): - raise ValueError(f'`optimization_parameters` must inherit from ' - f'`_OptimizationParameters`. ' - f'Received: `type(optimization_parameters)`=' - f'{type(optimization_parameters)}.') - - return super().__new__(cls, vocabulary_size, dimension, initializer, - combiner, hot_id_replication, learning_rate, - learning_rate_fn, optimization_parameters) - - -class FeatureConfig( - collections.namedtuple('FeatureConfig', - ['table_id', 'max_sequence_length', 'weight_key'])): - """Feature configuration.""" - - def __new__(cls, table_id, max_sequence_length=0, weight_key=None): - """Feature configuration. - - Args: - table_id: Which table the feature is uses for embedding lookups. - max_sequence_length: If positive, the feature is a sequence feature with - the corresponding maximum sequence length. If the sequence is longer - than this, it will be truncated. If 0, the feature is not a sequence - feature. - weight_key: If using weights for the combiner, this key specifies which - input feature contains the weights. - - Returns: - `FeatureConfig`. - - Raises: - ValueError: if `max_sequence_length` non-integer or negative. - """ - if not isinstance(max_sequence_length, int) or max_sequence_length < 0: - raise ValueError(f'max_sequence_length must be zero or a positive int, ' - f'got {max_sequence_length}.') - - return super().__new__(cls, table_id, max_sequence_length, weight_key) - - -class EnqueueData( - collections.namedtuple( - 'EnqueueData', - ['embedding_indices', 'sample_indices', 'aggregation_weights'])): - """Data to be enqueued through generate_enqueue_ops().""" - - def __new__(cls, - embedding_indices, - sample_indices=None, - aggregation_weights=None): - """Data to be enqueued through generate_enqueue_ops(). - - Args: - embedding_indices: A rank 1 Tensor, indices into the embedding tables. It - corresponds to sp_ids.values in embedding_lookup_sparse(). Both int32 - and int64 are allowed and will be converted to int32 internally. - sample_indices: A rank 2 Tensor specifying the training example to which - the corresponding embedding_indices and aggregation_weights values - belong. It corresponds to sp_ids.indices in embedding_lookup_sparse(). - If it is None, we assume each embedding_indices belongs to a different - sample. Both int32 and int64 are allowed and will be converted to int32 - internally. - aggregation_weights: A rank 1 Tensor containing aggregation weights. It - corresponds to sp_weights.values in embedding_lookup_sparse(). If it is - None, we assume all weights are 1. Both float32 and float64 are allowed - and will be converted to float32 internally. - - Returns: - An EnqueueData tuple. - - """ - return super().__new__(cls, embedding_indices, sample_indices, - aggregation_weights) - - @staticmethod - def from_sparse_tensor(sp_tensor, weights=None): - return EnqueueData( - sp_tensor.values, - sp_tensor.indices, - aggregation_weights=weights.values if weights is not None else None) - - -class RaggedEnqueueData( - collections.namedtuple( - 'RaggedEnqueueData', - ['embedding_indices', 'row_splits', 'aggregation_weights'])): - """RaggedTensor Data to be enqueued through generate_enqueue_ops().""" - - def __new__(cls, - embedding_indices, - row_splits=None, - aggregation_weights=None): - """Data to be enqueued through generate_enqueue_ops(). - - Args: - embedding_indices: A rank 1 Tensor, indices into the embedding tables. It - corresponds to ids.values in embedding_lookup(), when ids is a - RaggedTensor. Both int32 and int64 are allowed and will be converted to - int32 internally. - row_splits: A rank 1 Tensor specifying the length of the break points for - splitting embedding_indices and aggregation_weights. It corresponds to - ids.row_splits in embedding_lookup(), when ids is a RaggedTensor. Both - int32 and int64 are allowed and will be converted to int32 internally. - aggregation_weights: A rank 1 Tensor containing per training example - aggregation weights. It corresponds to the values field of a - RaggedTensor with the same row_splits as ids in embedding_lookup(), when - ids is a RaggedTensor. - - Returns: - An RaggedEnqueueData tuple. - - """ - return super().__new__(cls, embedding_indices, row_splits, - aggregation_weights) - - @staticmethod - def from_ragged_tensor(rg_tensor, weights=None): - return RaggedEnqueueData( - rg_tensor.values, - rg_tensor.row_splits, - aggregation_weights=weights.values if weights is not None else None) - - -def get_enqueue_datas_list_from_sparse_tensors_list(sp_tensors_list): - """Convenient function for generate_enqueue_ops(). - - Args: - sp_tensors_list: a list of dictionary mapping from string of feature names - to SparseTensor. Each dictionary is for one TPU core. Dictionaries for the - same host should be contiguous on the list. - - Returns: - enqueue_datas_list: a list of dictionary mapping from string - of feature names to EnqueueData. Each dictionary is for one - TPU core. Dictionaries for the same host should be contiguous - on the list. - - """ - enqueue_datas_list = [] - for sp_tensors in sp_tensors_list: - enqueue_datas = collections.OrderedDict( - (k, EnqueueData.from_sparse_tensor(v)) for k, v in sp_tensors.items()) - enqueue_datas_list.append(enqueue_datas) - return enqueue_datas_list - - -def get_enqueue_datas_list_from_ragged_tensors_list(rg_tensors_list): - """Convenient function for generate_enqueue_ops(). - - Args: - rg_tensors_list: a list of dictionary mapping from string of feature names - to RaggedTensor. Each dictionary is for one TPU core. Dictionaries for the - same host should be contiguous on the list. - - Returns: - enqueue_datas_list: a list of dictionary mapping from string - of feature names to RaggedEnqueueData. Each dictionary is for one - TPU core. Dictionaries for the same host should be contiguous - on the list. - - """ - enqueue_datas_list = [] - for rg_tensors in rg_tensors_list: - enqueue_datas = collections.OrderedDict( - (k, RaggedEnqueueData.from_ragged_tensor(v)) - for k, v in rg_tensors.items()) - enqueue_datas_list.append(enqueue_datas) - return enqueue_datas_list - - -AdamSlotVariableNames = collections.namedtuple('AdamSlotVariableNames', - ['m', 'v']) - -AdagradSlotVariableNames = collections.namedtuple('AdagradSlotVariableNames', - ['accumulator']) - -MomentumSlotVariableNames = collections.namedtuple('MomentumSlotVariableNames', - ['momenta']) - -AdagradMomentumSlotVariableNames = collections.namedtuple( - 'AdagradMomentumSlotVariableNames', ['accumulator', 'momenta']) - -RMSPropSlotVariableNames = collections.namedtuple('RMSPropSlotVariableNames', - ['ms', 'mom']) - -ProximalAdagradSlotVariableNames = collections.namedtuple( - 'ProximalAdagradSlotVariableNames', ['accumulator']) - -FtrlSlotVariableNames = collections.namedtuple('FtrlSlotVariableNames', - ['accumulator', 'linear']) - -ProximalYogiSlotVariableNames = collections.namedtuple( - 'ProximalYogiSlotVariableNames', ['v', 'm']) - -FrequencyEstimatorSlotVariableNames = collections.namedtuple( - 'FrequencyEstimatorSlotVariableNames', ['last_hit_step']) - -AdamSlotVariables = collections.namedtuple('AdamSlotVariables', ['m', 'v']) - -MomentumSlotVariables = collections.namedtuple('MomentumSlotVariables', - ['momenta']) - -AdagradMomentumSlotVariables = collections.namedtuple( - 'AdagradMomentumSlotVariables', ['accumulator', 'momenta']) - -RMSPropSlotVariables = collections.namedtuple('RMSPropSlotVariables', - ['ms', 'mom']) - -AdagradSlotVariables = collections.namedtuple('AdagradSlotVariables', - ['accumulator']) - -ProximalAdagradSlotVariables = collections.namedtuple( - 'ProximalAdagradSlotVariables', ['accumulator']) - -FtrlSlotVariable = collections.namedtuple('FtrlSlotVariable', - ['accumulator', 'linear']) - -ProximalYogiSlotVariables = collections.namedtuple('ProximalYogiSlotVariables', - ['v', 'm']) - -FrequencyEstimatorSlotVariables = collections.namedtuple( - 'FrequencyEstimatorSlotVariables', ['last_hit_step']) - -VariablesAndOps = collections.namedtuple('VariablesAndOps', [ - 'embedding_variables_by_table', 'slot_variables_by_table', 'load_ops', - 'retrieve_ops' -]) - - -class _OptimizationParameters: - """Parameters common to all optimizations.""" - - def __init__( - self, - learning_rate: float, - use_gradient_accumulation: bool, - clip_weight_min: Optional[float], - clip_weight_max: Optional[float], - weight_decay_factor: Optional[float], - multiply_weight_decay_factor_by_learning_rate: Optional[bool], - clip_gradient_min: Optional[float] = None, - clip_gradient_max: Optional[float] = None, - ): - self.learning_rate = learning_rate - self.use_gradient_accumulation = use_gradient_accumulation - self.clip_weight_min = clip_weight_min - self.clip_weight_max = clip_weight_max - self.weight_decay_factor = weight_decay_factor - self.multiply_weight_decay_factor_by_learning_rate = ( - multiply_weight_decay_factor_by_learning_rate) - self.clip_gradient_min = clip_gradient_min - self.clip_gradient_max = clip_gradient_max - - if not use_gradient_accumulation and (clip_gradient_min is not None or - clip_gradient_max is not None): - raise ValueError('When using gradient clipping limits, gradient ' - 'accumulation must be enabled.') - - -@tf_export(v1=['tpu.experimental.AdagradParameters']) -class AdagradParameters(_OptimizationParameters): - """Optimization parameters for Adagrad with TPU embeddings. - - Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the - `optimization_parameters` argument to set the optimizer and its parameters. - See the documentation for `tf.estimator.tpu.experimental.EmbeddingConfigSpec` - for more details. - - ``` - estimator = tf.estimator.tpu.TPUEstimator( - ... - embedding_spec=tf.estimator.tpu.experimental.EmbeddingConfigSpec( - ... - optimization_parameters=tf.tpu.experimental.AdagradParameters(0.1), - ...)) - ``` - - """ - - def __init__( - self, - learning_rate: float, - initial_accumulator: float = 0.1, - use_gradient_accumulation: bool = True, - clip_weight_min: Optional[float] = None, - clip_weight_max: Optional[float] = None, - weight_decay_factor: Optional[float] = None, - multiply_weight_decay_factor_by_learning_rate: Optional[bool] = None, - clip_gradient_min: Optional[float] = None, - clip_gradient_max: Optional[float] = None, - ): - """Optimization parameters for Adagrad. - - Args: - learning_rate: used for updating embedding table. - initial_accumulator: initial accumulator for Adagrad. - use_gradient_accumulation: setting this to `False` makes embedding - gradients calculation less accurate but faster. Please see - `optimization_parameters.proto` for details. - clip_weight_min: the minimum value to clip by; None means -infinity. - clip_weight_max: the maximum value to clip by; None means +infinity. - weight_decay_factor: amount of weight decay to apply; None means that the - weights are not decayed. - multiply_weight_decay_factor_by_learning_rate: if true, - `weight_decay_factor` is multiplied by the current learning rate. - clip_gradient_min: the minimum value to clip by; None means -infinity. - Gradient accumulation must be set to true if this is set. - clip_gradient_max: the maximum value to clip by; None means +infinity. - Gradient accumulation must be set to true if this is set. - """ - super().__init__( - learning_rate=learning_rate, - use_gradient_accumulation=use_gradient_accumulation, - clip_weight_min=clip_weight_min, - clip_weight_max=clip_weight_max, - weight_decay_factor=weight_decay_factor, - multiply_weight_decay_factor_by_learning_rate=( - multiply_weight_decay_factor_by_learning_rate), - clip_gradient_min=clip_gradient_min, - clip_gradient_max=clip_gradient_max, - ) - if initial_accumulator <= 0: - raise ValueError( - f'Adagrad initial_accumulator must be greater than zero. ' - f'Received: {initial_accumulator}.') - self.initial_accumulator = initial_accumulator - - -class AdagradMomentumParameters(_OptimizationParameters): - """Optimization parameters for Adagrad + Momentum with TPU embeddings. - - Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the - `optimization_parameters` argument to set the optimizer and its parameters. - See the documentation for `tf.estimator.tpu.experimental.EmbeddingConfigSpec` - for more details. - - ``` - estimator = tf.estimator.tpu.TPUEstimator( - ... - embedding_spec=tf.estimator.tpu.experimental.EmbeddingConfigSpec( - ... - optimization_parameters=tf.tpu.experimental.AdagradMomentumParameters(0.1), - ...)) - ``` - - """ - - def __init__( - self, - learning_rate: float, - momentum: float, - use_nesterov: bool = False, - exponent: float = 2, - beta2: float = 1, - epsilon: float = 1e-10, - use_gradient_accumulation: bool = True, - clip_weight_min: Optional[float] = None, - clip_weight_max: Optional[float] = None, - weight_decay_factor: Optional[float] = None, - multiply_weight_decay_factor_by_learning_rate: Optional[bool] = None, - clip_gradient_min: Optional[float] = None, - clip_gradient_max: Optional[float] = None, - ): - """Optimization parameters for Adagrad. - - Args: - learning_rate: used for updating embedding table. - momentum: Moving average parameter for the momentum accumulator. - use_nesterov: Whether to use the Nesterov variant of momentum. See - Sutskever et al., 2013. - exponent: Exponent for the Adagrad accumulator. - beta2: Moving average parameter for the Adagrad accumulator. - epsilon: initial accumulator for Adagrad accumulator. - use_gradient_accumulation: setting this to `False` makes embedding - gradients calculation less accurate but faster. Please see - `optimization_parameters.proto` for details. - clip_weight_min: the minimum value to clip by; None means -infinity. - clip_weight_max: the maximum value to clip by; None means +infinity. - weight_decay_factor: amount of weight decay to apply; None means that the - weights are not decayed. - multiply_weight_decay_factor_by_learning_rate: if true, - `weight_decay_factor` is multiplied by the current learning rate. - clip_gradient_min: the minimum value to clip by; None means -infinity. - Gradient accumulation must be set to true if this is set. - clip_gradient_max: the maximum value to clip by; None means +infinity. - Gradient accumulation must be set to true if this is set. - """ - super().__init__( - learning_rate=learning_rate, - use_gradient_accumulation=use_gradient_accumulation, - clip_weight_min=clip_weight_min, - clip_weight_max=clip_weight_max, - weight_decay_factor=weight_decay_factor, - multiply_weight_decay_factor_by_learning_rate=( - multiply_weight_decay_factor_by_learning_rate), - clip_gradient_min=clip_gradient_min, - clip_gradient_max=clip_gradient_max, - ) - if epsilon <= 0: - raise ValueError('Adagrad momentum: epsilon must be positive') - if exponent <= 0: - raise ValueError('Adagrad momentum: Precondition exponent must >0') - self.momentum = momentum - self.use_nesterov = use_nesterov - self.exponent = exponent - self.beta2 = beta2 - self.epsilon = epsilon - - -class ProximalAdagradParameters(_OptimizationParameters): - """Optimization parameters for ProximalAdagrad with TPU embeddings. - - Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the - `optimization_parameters` argument to set the optimizer and its parameters. - See the documentation for `tf.estimator.tpu.experimental.EmbeddingConfigSpec` - for more details. - """ - - def __init__( - self, - learning_rate: float, - initial_accumulator: float = 0.1, - l1_regularization_strength: float = 0.0, - l2_regularization_strength: float = 0.0, - use_gradient_accumulation: bool = True, - clip_weight_min: Optional[float] = None, - clip_weight_max: Optional[float] = None, - weight_decay_factor: Optional[float] = None, - multiply_weight_decay_factor_by_learning_rate: Optional[bool] = None, - clip_gradient_min: Optional[float] = None, - clip_gradient_max: Optional[float] = None, - ): - """Optimization parameters for Adagrad. - - Args: - learning_rate: used for updating embedding table. - initial_accumulator: initial accumulator for Adagrad. - l1_regularization_strength: A float value, must be greater than or equal - to zero. - l2_regularization_strength: A float value, must be greater than or equal - to zero. - use_gradient_accumulation: setting this to `False` makes embedding - gradients calculation less accurate but faster. Please see - `optimization_parameters.proto` for details. for details. - clip_weight_min: the minimum value to clip by; None means -infinity. - clip_weight_max: the maximum value to clip by; None means +infinity. - weight_decay_factor: amount of weight decay to apply; None means that the - weights are not decayed. - multiply_weight_decay_factor_by_learning_rate: if true, - `weight_decay_factor` is multiplied by the current learning rate. - clip_gradient_min: the minimum value to clip by; None means -infinity. - Gradient accumulation must be set to true if this is set. - clip_gradient_max: the maximum value to clip by; None means +infinity. - Gradient accumulation must be set to true if this is set. - """ - super().__init__( - learning_rate=learning_rate, - use_gradient_accumulation=use_gradient_accumulation, - clip_weight_min=clip_weight_min, - clip_weight_max=clip_weight_max, - weight_decay_factor=weight_decay_factor, - multiply_weight_decay_factor_by_learning_rate=( - multiply_weight_decay_factor_by_learning_rate), - clip_gradient_min=clip_gradient_min, - clip_gradient_max=clip_gradient_max, - ) - if initial_accumulator <= 0: - raise ValueError(f'Adagrad initial_accumulator must be positive. ' - f'Received: {initial_accumulator}.') - if l1_regularization_strength < 0.: - raise ValueError('l1_regularization_strength must be greater than or ' - 'equal to 0. got {}.'.format(l1_regularization_strength)) - - if l2_regularization_strength < 0.: - raise ValueError('l2_regularization_strength must be greater than or ' - 'equal to 0. got {}.'.format(l2_regularization_strength)) - - self.initial_accumulator = initial_accumulator - self.l1_regularization_strength = l1_regularization_strength - self.l2_regularization_strength = l2_regularization_strength - - -@tf_export(v1=['tpu.experimental.AdamParameters']) -class AdamParameters(_OptimizationParameters): - """Optimization parameters for Adam with TPU embeddings. - - Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the - `optimization_parameters` argument to set the optimizer and its parameters. - See the documentation for `tf.estimator.tpu.experimental.EmbeddingConfigSpec` - for more details. - - ``` - estimator = tf.estimator.tpu.TPUEstimator( - ... - embedding_config_spec=tf.estimator.tpu.experimental.EmbeddingConfigSpec( - ... - optimization_parameters=tf.tpu.experimental.AdamParameters(0.1), - ...)) - ``` - - """ - - def __init__( - self, - learning_rate: float, - beta1: float = 0.9, - beta2: float = 0.999, - epsilon: float = 1e-08, - lazy_adam: bool = True, - sum_inside_sqrt: bool = True, - use_gradient_accumulation: bool = True, - clip_weight_min: Optional[float] = None, - clip_weight_max: Optional[float] = None, - weight_decay_factor: Optional[float] = None, - multiply_weight_decay_factor_by_learning_rate: Optional[bool] = None, - clip_gradient_min: Optional[float] = None, - clip_gradient_max: Optional[float] = None, - ): - """Optimization parameters for Adam. - - Args: - learning_rate: a floating point value. The learning rate. - beta1: A float value. The exponential decay rate for the 1st moment - estimates. - beta2: A float value. The exponential decay rate for the 2nd moment - estimates. - epsilon: A small constant for numerical stability. - lazy_adam: Use lazy Adam instead of Adam. Lazy Adam trains faster. See - `optimization_parameters.proto` for details. - sum_inside_sqrt: This improves training speed. Please see - `optimization_parameters.proto` for details. - use_gradient_accumulation: setting this to `False` makes embedding - gradients calculation less accurate but faster. Please see - `optimization_parameters.proto` for details. - clip_weight_min: the minimum value to clip by; None means -infinity. - clip_weight_max: the maximum value to clip by; None means +infinity. - weight_decay_factor: amount of weight decay to apply; None means that the - weights are not decayed. - multiply_weight_decay_factor_by_learning_rate: if true, - `weight_decay_factor` is multiplied by the current learning rate. - clip_gradient_min: the minimum value to clip by; None means -infinity. - Gradient accumulation must be set to true if this is set. - clip_gradient_max: the maximum value to clip by; None means +infinity. - Gradient accumulation must be set to true if this is set. - """ - super().__init__( - learning_rate=learning_rate, - use_gradient_accumulation=use_gradient_accumulation, - clip_weight_min=clip_weight_min, - clip_weight_max=clip_weight_max, - weight_decay_factor=weight_decay_factor, - multiply_weight_decay_factor_by_learning_rate=( - multiply_weight_decay_factor_by_learning_rate), - clip_gradient_min=clip_gradient_min, - clip_gradient_max=clip_gradient_max, - ) - if beta1 < 0. or beta1 >= 1.: - raise ValueError('beta1 must be between 0. and 1; got {}.'.format(beta1)) - if beta2 < 0. or beta2 >= 1.: - raise ValueError('beta2 must be between 0. and 1; got {}.'.format(beta2)) - if epsilon <= 0.: - raise ValueError('epsilon must be positive; got {}.'.format(epsilon)) - if not use_gradient_accumulation and not lazy_adam: - raise ValueError( - 'When disabling Lazy Adam, gradient accumulation must be used.') - - self.beta1 = beta1 - self.beta2 = beta2 - self.epsilon = epsilon - self.lazy_adam = lazy_adam - self.sum_inside_sqrt = sum_inside_sqrt - - -@tf_export(v1=['tpu.experimental.FtrlParameters']) -class FtrlParameters(_OptimizationParameters): - """Optimization parameters for Ftrl with TPU embeddings. - - Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the - `optimization_parameters` argument to set the optimizer and its parameters. - See the documentation for `tf.estimator.tpu.experimental.EmbeddingConfigSpec` - for more details. - - ``` - estimator = tf.estimator.tpu.TPUEstimator( - ... - embedding_config_spec=tf.estimator.tpu.experimental.EmbeddingConfigSpec( - ... - optimization_parameters=tf.tpu.experimental.FtrlParameters(0.1), - ...)) - ``` - - """ - - def __init__( - self, - learning_rate: float, - learning_rate_power: float = -0.5, - initial_accumulator_value: float = 0.1, - l1_regularization_strength: float = 0.0, - l2_regularization_strength: float = 0.0, - use_gradient_accumulation: bool = True, - clip_weight_min: Optional[float] = None, - clip_weight_max: Optional[float] = None, - weight_decay_factor: Optional[float] = None, - multiply_weight_decay_factor_by_learning_rate: Optional[bool] = None, - multiply_linear_by_learning_rate: bool = False, - beta: float = 0, - allow_zero_accumulator: bool = False, - clip_gradient_min: Optional[float] = None, - clip_gradient_max: Optional[float] = None, - ): - """Optimization parameters for Ftrl. - - Implements FTRL as described in the following [paper]( - https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/41159.pdf) - - Args: - learning_rate: a floating point value. The learning rate. - learning_rate_power: A float value, must be less or equal to zero. - Controls how the learning rate decreases during training. Use zero for a - fixed learning rate. See section 3.1 in the - [paper](https://www.eecs.tufts.edu/~dsculley/papers/ad-click-prediction.pdf). - initial_accumulator_value: The starting value for accumulators. Only zero - or positive values are allowed. - l1_regularization_strength: A float value, must be greater than or equal - to zero. - l2_regularization_strength: A float value, must be greater than or equal - to zero. - use_gradient_accumulation: setting this to `False` makes embedding - gradients calculation less accurate but faster. Please see - `optimization_parameters.proto` for details. for details. - clip_weight_min: the minimum value to clip by; None means -infinity. - clip_weight_max: the maximum value to clip by; None means +infinity. - weight_decay_factor: amount of weight decay to apply; None means that the - weights are not decayed. - multiply_weight_decay_factor_by_learning_rate: if true, - `weight_decay_factor` is multiplied by the current learning rate. - multiply_linear_by_learning_rate: When true, multiplies the usages of the - linear slot in the weight update by the learning rate. This is useful - when ramping up learning rate from 0 (which would normally produce - NaNs). - beta: The beta parameter for FTRL. - allow_zero_accumulator: Changes the implementation of the square root to - allow for the case of initial_accumulator_value being zero. This will - cause a slight performance drop. - clip_gradient_min: the minimum value to clip by; None means -infinity. - Gradient accumulation must be set to true if this is set. - clip_gradient_max: the maximum value to clip by; None means +infinity. - Gradient accumulation must be set to true if this is set. - """ - super().__init__( - learning_rate=learning_rate, - use_gradient_accumulation=use_gradient_accumulation, - clip_weight_min=clip_weight_min, - clip_weight_max=clip_weight_max, - weight_decay_factor=weight_decay_factor, - multiply_weight_decay_factor_by_learning_rate=( - multiply_weight_decay_factor_by_learning_rate), - clip_gradient_min=clip_gradient_min, - clip_gradient_max=clip_gradient_max, - ) - if learning_rate_power > 0.: - raise ValueError('learning_rate_power must be less than or equal to 0. ' - 'got {}.'.format(learning_rate_power)) - - if initial_accumulator_value < 0.: - raise ValueError('initial_accumulator_value must be greater than or equal' - ' to 0. got {}.'.format(initial_accumulator_value)) - - if l1_regularization_strength < 0.: - raise ValueError('l1_regularization_strength must be greater than or ' - 'equal to 0. got {}.'.format(l1_regularization_strength)) - - if l2_regularization_strength < 0.: - raise ValueError('l2_regularization_strength must be greater than or ' - 'equal to 0. got {}.'.format(l2_regularization_strength)) - - self.learning_rate_power = learning_rate_power - self.initial_accumulator_value = initial_accumulator_value - self.initial_linear_value = 0.0 - self.l1_regularization_strength = l1_regularization_strength - self.l2_regularization_strength = l2_regularization_strength - self.multiply_linear_by_learning_rate = multiply_linear_by_learning_rate - self.beta = beta - self.allow_zero_accumulator = allow_zero_accumulator - - -class ProximalYogiParameters(_OptimizationParameters): - # pylint: disable=line-too-long - """Optimization parameters for Proximal Yogi with TPU embeddings. - - Implements the Yogi optimizer as described in - [Adaptive Methods for Nonconvex - Optimization](https://papers.nips.cc/paper/8186-adaptive-methods-for-nonconvex-optimization). - - Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the - `optimization_parameters` argument to set the optimizer and its parameters. - See the documentation for `tf.estimator.tpu.experimental.EmbeddingConfigSpec` - for more details. - """ - - # pylint: enable=line-too-long - - def __init__( - self, - learning_rate: float = 0.01, - beta1: float = 0.9, - beta2: float = 0.999, - epsilon: float = 1e-3, - l1_regularization_strength: float = 0.0, - l2_regularization_strength: float = 0.0, - initial_accumulator_value: float = 1e-6, - use_gradient_accumulation: bool = True, - clip_weight_min: Optional[float] = None, - clip_weight_max: Optional[float] = None, - weight_decay_factor: Optional[float] = None, - multiply_weight_decay_factor_by_learning_rate: Optional[bool] = None, - clip_gradient_min: Optional[float] = None, - clip_gradient_max: Optional[float] = None, - ): - """Optimization parameters for Proximal Yogi. - - Args: - learning_rate: a floating point value. The learning rate. - beta1: A float value. The exponential decay rate for the 1st moment - estimates. - beta2: A float value. The exponential decay rate for the 2nd moment - estimates. - epsilon: A small constant for numerical stability. - l1_regularization_strength: A float value, must be greater than or equal - to zero. - l2_regularization_strength: A float value, must be greater than or equal - to zero. - initial_accumulator_value: The starting value for accumulators. Only zero - or positive values are allowed. - use_gradient_accumulation: setting this to `False` makes embedding - gradients calculation less accurate but faster. Please see - `optimization_parameters.proto` for details. for details. - clip_weight_min: the minimum value to clip by; None means -infinity. - clip_weight_max: the maximum value to clip by; None means +infinity. - weight_decay_factor: amount of weight decay to apply; None means that the - weights are not decayed. - multiply_weight_decay_factor_by_learning_rate: if true, - `weight_decay_factor` is multiplied by the current learning rate. - clip_gradient_min: the minimum value to clip by; None means -infinity. - Gradient accumulation must be set to true if this is set. - clip_gradient_max: the maximum value to clip by; None means +infinity. - Gradient accumulation must be set to true if this is set. - """ - super().__init__( - learning_rate=learning_rate, - use_gradient_accumulation=use_gradient_accumulation, - clip_weight_min=clip_weight_min, - clip_weight_max=clip_weight_max, - weight_decay_factor=weight_decay_factor, - multiply_weight_decay_factor_by_learning_rate=( - multiply_weight_decay_factor_by_learning_rate), - clip_gradient_min=clip_gradient_min, - clip_gradient_max=clip_gradient_max, - ) - if beta1 < 0. or beta1 >= 1.: - raise ValueError('beta1 must be between 0. and 1; got {}.'.format(beta1)) - if beta2 < 0. or beta2 >= 1.: - raise ValueError('beta2 must be between 0. and 1; got {}.'.format(beta2)) - if epsilon <= 0.: - raise ValueError('epsilon must be positive; got {}.'.format(epsilon)) - if l1_regularization_strength < 0.: - raise ValueError('l1_regularization_strength must be greater than or ' - 'equal to 0. got {}.'.format(l1_regularization_strength)) - if l2_regularization_strength < 0.: - raise ValueError('l2_regularization_strength must be greater than or ' - 'equal to 0. got {}.'.format(l2_regularization_strength)) - - self.beta1 = beta1 - self.beta2 = beta2 - self.epsilon = epsilon - self.l1_regularization_strength = l1_regularization_strength - self.l2_regularization_strength = l2_regularization_strength - self.initial_accumulator_value = initial_accumulator_value - - -class MomentumParameters(_OptimizationParameters): - """Optimization parameters for Momentum with TPU embeddings. - - Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the - `optimization_parameters` argument to set the optimizer and its parameters. - See the documentation for `tf.estimator.tpu.experimental.EmbeddingConfigSpec` - for more details. - - ``` - estimator = tf.estimator.tpu.TPUEstimator( - ... - embedding_spec=tf.estimator.tpu.experimental.EmbeddingConfigSpec( - ... - optimization_parameters=tf.tpu.experimental.MomentumParameters(0.1), - ...)) - ``` - - """ - - def __init__( - self, - learning_rate: float, - momentum: float, - use_nesterov: bool = False, - use_gradient_accumulation: bool = True, - clip_weight_min: Optional[float] = None, - clip_weight_max: Optional[float] = None, - weight_decay_factor: Optional[float] = None, - multiply_weight_decay_factor_by_learning_rate: Optional[bool] = None, - clip_gradient_min: Optional[float] = None, - clip_gradient_max: Optional[float] = None, - ): - """Optimization parameters for momentum. - - Args: - learning_rate: a floating point value. The learning rate. - momentum: a floating point value. The momentum. - use_nesterov: If `True` use Nesterov Momentum. See (Sutskever et al., - 2013). This implementation always computes gradients at the value of the - variable(s) passed to the optimizer. Using Nesterov Momentum makes the - variable(s) track the values called `theta_t + mu*v_t` in the paper. - This implementation is an approximation of the original formula, valid - for high values of momentum. It will compute the "adjusted gradient" in - NAG by assuming that the new gradient will be estimated by the current - average gradient plus the product of momentum and the change in the - average gradient. - use_gradient_accumulation: setting this to `False` makes embedding - gradients calculation less accurate but faster. Please see - `optimization_parameters.proto` for details. - clip_weight_min: the minimum value to clip by; None means -infinity. - clip_weight_max: the maximum value to clip by; None means +infinity. - weight_decay_factor: amount of weight decay to apply; None means that the - weights are not decayed. - multiply_weight_decay_factor_by_learning_rate: if true, - `weight_decay_factor` is multiplied by the current learning rate. - clip_gradient_min: the minimum value to clip by; None means -infinity. - Gradient accumulation must be set to true if this is set. - clip_gradient_max: the maximum value to clip by; None means +infinity. - Gradient accumulation must be set to true if this is set. - """ - super().__init__( - learning_rate=learning_rate, - use_gradient_accumulation=use_gradient_accumulation, - clip_weight_min=clip_weight_min, - clip_weight_max=clip_weight_max, - weight_decay_factor=weight_decay_factor, - multiply_weight_decay_factor_by_learning_rate=( - multiply_weight_decay_factor_by_learning_rate), - clip_gradient_min=clip_gradient_min, - clip_gradient_max=clip_gradient_max, - ) - self.momentum = momentum - self.use_nesterov = use_nesterov - - -class RMSPropParameters(_OptimizationParameters): - """Optimization parameters for RMSProp with TPU embeddings. - - Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the - `optimization_parameters` argument to set the optimizer and its parameters. - See the documentation for `tf.estimator.tpu.experimental.EmbeddingConfigSpec` - for more details. - - ``` - estimator = tf.estimator.tpu.TPUEstimator( - ... - embedding_spec=tf.estimator.tpu.experimental.EmbeddingConfigSpec( - ... - optimization_parameters=tf.tpu.experimental.MomentumParameters(0.1), - ...)) - ``` - - """ - - def __init__( - self, - learning_rate: float, - rho: float, - momentum: float, - epsilon: float, - use_gradient_accumulation: bool = True, - clip_weight_min: Optional[float] = None, - clip_weight_max: Optional[float] = None, - weight_decay_factor: Optional[float] = None, - multiply_weight_decay_factor_by_learning_rate: Optional[bool] = None, - clip_gradient_min: Optional[float] = None, - clip_gradient_max: Optional[float] = None, - ): - """Optimization parameters for RMS prop. - - Args: - learning_rate: a floating point value. The learning rate. - rho: Discounting factor for the history/coming gradient - momentum: A scalar tensor. - epsilon: Small value to avoid zero denominator. - use_gradient_accumulation: setting this to `False` makes embedding - gradients calculation less accurate but faster. Please see - `optimization_parameters.proto` for details. for details. - clip_weight_min: the minimum value to clip by; None means -infinity. - clip_weight_max: the maximum value to clip by; None means +infinity. - weight_decay_factor: amount of weight decay to apply; None means that the - weights are not decayed. - multiply_weight_decay_factor_by_learning_rate: if true, - `weight_decay_factor` is multiplied by the current learning rate. - clip_gradient_min: the minimum value to clip by; None means -infinity. - Gradient accumulation must be set to true if this is set. - clip_gradient_max: the maximum value to clip by; None means +infinity. - Gradient accumulation must be set to true if this is set. - """ - super().__init__( - learning_rate=learning_rate, - use_gradient_accumulation=use_gradient_accumulation, - clip_weight_min=clip_weight_min, - clip_weight_max=clip_weight_max, - weight_decay_factor=weight_decay_factor, - multiply_weight_decay_factor_by_learning_rate=( - multiply_weight_decay_factor_by_learning_rate), - clip_gradient_min=clip_gradient_min, - clip_gradient_max=clip_gradient_max, - ) - self.rho = rho - self.momentum = momentum - self.epsilon = epsilon - - -@tf_export(v1=['tpu.experimental.StochasticGradientDescentParameters']) -class StochasticGradientDescentParameters(_OptimizationParameters): - """Optimization parameters for stochastic gradient descent for TPU embeddings. - - Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the - `optimization_parameters` argument to set the optimizer and its parameters. - See the documentation for `tf.estimator.tpu.experimental.EmbeddingConfigSpec` - for more details. - - ``` - estimator = tf.estimator.tpu.TPUEstimator( - ... - embedding_config_spec=tf.estimator.tpu.experimental.EmbeddingConfigSpec( - ... - optimization_parameters=( - tf.tpu.experimental.StochasticGradientDescentParameters(0.1)))) - ``` - - """ - - def __init__( - self, - learning_rate: float, - use_gradient_accumulation: bool = True, - clip_weight_min: Optional[float] = None, - clip_weight_max: Optional[float] = None, - weight_decay_factor: Optional[float] = None, - multiply_weight_decay_factor_by_learning_rate: Optional[bool] = None, - clip_gradient_min: Optional[float] = None, - clip_gradient_max: Optional[float] = None, - ): - """Optimization parameters for stochastic gradient descent. - - Args: - learning_rate: a floating point value. The learning rate. - use_gradient_accumulation: setting this to `False` makes embedding - gradients calculation less accurate but faster. Please see - `optimization_parameters.proto` for details. - clip_weight_min: the minimum value to clip by; None means -infinity. - clip_weight_max: the maximum value to clip by; None means +infinity. - weight_decay_factor: amount of weight decay to apply; None means that the - weights are not decayed. - multiply_weight_decay_factor_by_learning_rate: if true, - `weight_decay_factor` is multiplied by the current learning rate. - clip_gradient_min: the minimum value to clip by; None means -infinity. - clip_gradient_max: the maximum value to clip by; None means +infinity. - """ - super().__init__( - learning_rate=learning_rate, - use_gradient_accumulation=use_gradient_accumulation, - clip_weight_min=clip_weight_min, - clip_weight_max=clip_weight_max, - weight_decay_factor=weight_decay_factor, - multiply_weight_decay_factor_by_learning_rate=( - multiply_weight_decay_factor_by_learning_rate), - clip_gradient_min=clip_gradient_min, - clip_gradient_max=clip_gradient_max, - ) - - -class FrequencyEstimatorParameters(_OptimizationParameters): - """Optimization parameters for Frequency Estimator TPU embeddings. - - This is a non-standard optimizer, which returns the estimated frequency of - lookup for the feature passed to it. It should only be used on a table of - width 1. The gradient fed back to the TPU embedding should always be zero. - This can be acomplished via using `tf.stop_gradients` on the feature before - using it. - - You must use the dynamic learning rate mechanism to set the 'learning rate' - for this table to be the a float32 cast of the global training step counter. - - See `tensorflow/core/protobuf/tpu/optimization_parameters.proto` for more - details on this optimizer. - - Pass this to `tf.estimator.tpu.experimental.EmbeddingConfigSpec` via the - `optimization_parameters` argument to set the optimizer and its parameters. - See the documentation for `tf.estimator.tpu.experimental.EmbeddingConfigSpec` - for more details. - - ``` - estimator = tf.estimator.tpu.TPUEstimator( - ... - embedding_spec=tf.estimator.tpu.experimental.EmbeddingConfigSpec( - ... - optimization_parameters=FrequencyEstimatorParameters(0.1), - ...)) - ``` - - """ - - def __init__(self, tau: float, max_delta: float, outlier_threshold: float, - weight_exponent: float): - """Optimization parameters for frequency estimator. - - Args: - tau: Learning rate between (0, 1) that is used to update the array. - max_delta: Maximum value of delta, the difference between the current - global step and the last global step at which the row was sampled. - outlier_threshold: Threshold used to determine whether the current update - is an outlier. - weight_exponent: The weight exponent used to transform the estimated delta - into weights. - """ - super().__init__( - learning_rate=1.0, - use_gradient_accumulation=True, - clip_weight_min=None, - clip_weight_max=None, - weight_decay_factor=None, - multiply_weight_decay_factor_by_learning_rate=None, - ) - self.tau = tau - self.max_delta = max_delta - self.outlier_threshold = outlier_threshold - self.weight_exponent = weight_exponent - - -DeviceConfig = collections.namedtuple('DeviceConfig', - ['num_hosts', 'num_cores', 'job_name']) - - -class TPUEmbedding: - """API for using TPU for embedding. - - Example: - ``` - table_config_user = tpu_embedding.TableConfig( - vocabulary_size=4, dimension=2, - initializer=initializer, combiner='mean') - table_to_config_dict = {'video': table_config_video, - 'user': table_config_user} - feature_to_config_dict = {'watched': tpu_embedding.FeatureConfig('video'), - 'favorited': tpu_embedding.FeatureConfig('video'), - 'friends': tpu_embedding.FeatureConfig('user')} - batch_size = 4 - num_hosts = 1 - optimization_parameters = tpu_embedding.AdagradParameters(1., 1.) - mode = tpu_embedding.TRAINING - embedding = tpu_embedding.TPUEmbedding( - table_to_config_dict, feature_to_config_dict, - batch_size, num_hosts, mode, optimization_parameters) - - batch_size_per_core = embedding.batch_size_per_core - sparse_features_list = [] - for host in hosts: - with ops.device(host): - for _ in range(embedding.num_cores_per_host): - sparse_features = {} - sparse_features['watched'] = sparse_tensor.SparseTensor(...) - sparse_features['favorited'] = sparse_tensor.SparseTensor(...) - sparse_features['friends'] = sparse_tensor.SparseTensor(...) - sparse_features_list.append(sparse_features) - - enqueue_ops = embedding.generate_enqueue_ops(sparse_features_list) - embedding_variables_and_ops = embedding.create_variables_and_ops() - - def computation(): - activations = embedding.get_activations() - loss = compute_loss(activations) - - base_optimizer = gradient_descent.GradientDescentOptimizer( - learning_rate=1) - cross_shard_optimizer = tpu_optimizer.CrossShardOptimizer( - base_optimizer) - - train_op = cross_shard_optimizer.minimize(loss) - gradients = ( - tpu_embedding_gradient.get_gradients_through_compute_gradients( - cross_shard_optimizer, loss, activations) - send_gradients_op = embedding.generate_send_gradients_op(gradients) - with ops.control_dependencies([train_op, send_gradients_op]): - loss = array_ops.identity(loss) - - loss = tpu.shard(computation, - num_shards=embedding.num_cores) - - with self.test_session() as sess: - sess.run(tpu.initialize_system(embedding_config= - embedding.config_proto)) - sess.run(variables.global_variables_initializer()) - sess.run(embedding_variables_and_ops.load_ops()) - sess.run(enqueue_ops) - loss_val = sess.run(loss) - ``` - - Example with weight decay: - - >>> def learning_rate_fn(global_step): - ... return tf.compat.v1.train.polynomial_decay( - ... learning_rate=5e-5, - ... global_step=global_step, - ... decay_steps=100000, - ... end_learning_rate=0.0) - >>> wordpiece_table_config = TableConfig( - ... vocabulary_size=119547, - ... dimension=256, - ... learning_rate_fn=learning_rate_fn) - >>> wordpiece_feature_config = FeatureConfig( - ... table_id='bert/embeddings/word_embeddings', - ... max_sequence_length=512) - >>> optimization_parameters = AdamParameters( - ... learning_rate=5e-5, - ... epsilon=1e-6, - ... weight_decay_factor=0.01, - ... multiply_weight_decay_factor_by_learning_rate=True) - >>> tpu_embedding = TPUEmbedding( - ... table_to_config_dict={ - ... 'bert/embeddings/word_embeddings': wordpiece_table_config, - ... }, - ... feature_to_config_dict={'input_ids': wordpiece_feature_config}, - ... batch_size=128, - ... mode=TRAINING, - ... optimization_parameters=optimization_parameters, - ... master='') - >>> with tf.Graph().as_default(): - ... init_tpu_op = tf.compat.v1.tpu.initialize_system( - ... embedding_config=tpu_embedding.config_proto) - ... tf.compat.v1.Session().run(init_tpu_op) - """ - - # TODO(shizhiw): Consider adding a field to FeatureConfig that indicates that - # the feature should not be used to update embedding table (cr/204852758, - # cr/204940540). Also, this can support different combiners for different - # features within the same table. - # TODO(shizhiw, b/118512626): Remove `batch_size` from `__init__` and move it - # to `FeatureConfig`? - - # TODO(shizhiw): will it be cleaner to make `table_to_config_dict` and - # `feature_to_config_dict` lists of `TableSpec` and `FeatureSpec` - # respectively? - - # TODO(shizhiw): Consider adding `input_fn` as an option to remove boilerplate - # for-loops around construction of inputs. - - # `optimization_parameter` applies to all tables. If the need arises, - # we can add `optimization_parameters` to `TableConfig` to override this - # global setting. - def __init__(self, - table_to_config_dict, - feature_to_config_dict, - batch_size, - mode, - master=None, - optimization_parameters=None, - cluster_def=None, - pipeline_execution_with_tensor_core=False, - partition_strategy='div', - profile_data_directory=None, - device_config=None, - master_job_name=None): - """API for using TPU for embedding lookups. - - Args: - table_to_config_dict: A dictionary mapping from string of table name to - `TableConfig`. Table refers to an embedding table, e.g. `params` - argument to `tf.nn.embedding_lookup_sparse()`. - feature_to_config_dict: A dictionary mapping from string of feature name - to `FeatureConfig`. Feature refers to ids to lookup in embedding table, - e.g. `sp_ids` argument to `tf.nn.embedding_lookup_sparse()`. - batch_size: An `int` representing the global batch size. - mode: `TRAINING` or `INFERENCE`. - master: A `string` representing the TensorFlow master to use. - optimization_parameters: `AdagradParameters`, `AdamParameters`, - `Stochasticgradientdescentparameters`. Must be set in training unless - all tables specify their own optimizers. And it must be `None` in - inference. - cluster_def: A ClusterDef object describing the TPU cluster. - pipeline_execution_with_tensor_core: setting this to `True` makes training - faster, but trained model will be different if step N and step N+1 - involve the same set of embedding IDs. Please see - `tpu_embedding_configuration.proto` for details. - partition_strategy: A string, either 'mod' or 'div', specifying how to map - the lookup id to the embedding tensor. For more information see - `tf.nn.embedding_lookup_sparse`. - profile_data_directory: Directory where embedding lookup statistics are - stored. These statistics summarize information about the inputs to the - embedding lookup operation, in particular, the average number of - embedding IDs per example and how well the embedding IDs are load - balanced across the system. The lookup statistics are used during TPU - initialization for embedding table partitioning. Collection of lookup - statistics is done at runtime by profiling the embedding inputs, only a - small fraction of input samples are profiled to minimize host CPU - overhead. Once a suitable number of samples are profiled, the lookup - statistics are saved to table-specific files in the profile data - directory generally at the end of a TPU training loop. The filename - corresponding to each table is obtained by hashing table specific - parameters (e.g., table name and number of features) and global - configuration parameters (e.g., sharding strategy and task count). The - same profile data directory can be shared among several models to reuse - embedding lookup statistics. - device_config: A DeviceConfig instance, used when `master` and - `cluster_def` are both `None`. - master_job_name: if set, overrides the master job name used to schedule - embedding ops. - - Raises: - ValueError: if any input is invalid. - """ - if partition_strategy not in ('div', 'mod'): - raise ValueError(f'partition_strategy must be "div" or "mod". ' - f'Received: {partition_strategy}.') - self._partition_strategy = partition_strategy - - self._profile_data_directory = profile_data_directory - - _validate_table_to_config_dict(table_to_config_dict) - # Avoid nondeterminism from `Dict` iteration order by using `OrderedDict`. - self._table_to_config_dict = _create_ordered_dict(table_to_config_dict) - - _validate_feature_to_config_dict(table_to_config_dict, - feature_to_config_dict) - self._feature_to_config_dict = _create_ordered_dict(feature_to_config_dict) - self._table_to_features_dict = ( - _create_table_to_features_dict(self._feature_to_config_dict)) - self._combiners = _create_combiners(self._table_to_config_dict, - self._table_to_features_dict) - - self._batch_size = batch_size - - if master is None and cluster_def is None: - if device_config is None: - raise ValueError('When master and cluster_def are both None,' - 'device_config must be set but is not.') - if device_config.num_cores % device_config.num_hosts: - raise ValueError('num_hosts ({}) should divide num_cores ({}) ' - 'but does not.'.format(device_config.num_cores, - device_config.num_hosts)) - self._num_hosts = device_config.num_hosts - self._num_cores = device_config.num_cores - self._num_cores_per_host = self._num_cores // self._num_hosts - self._hosts = [ - '{}/replica:0/task:{}/device:CPU:0'.format(device_config.job_name, i) - for i in range(self._num_hosts) - ] - else: - tpu_system_metadata = ( - tpu_system_metadata_lib._query_tpu_system_metadata( # pylint: disable=protected-access - master, - cluster_def=cluster_def)) - if tpu_system_metadata.num_cores == 0: - raise ValueError('TPUEmbedding needs TPUs, but master {} does not have ' - 'TPUs.'.format(master)) - self._num_hosts = tpu_system_metadata.num_hosts - if master_job_name is None: - try: - master_job_name = tpu_system_metadata_lib.master_job( - master, cluster_def) - except ValueError as e: - raise ValueError(str(e) + ' Please specify a master_job_name.') - self._hosts = [] - for device in tpu_system_metadata.devices: - if 'device:CPU:' in device.name and (master_job_name is None or - master_job_name in device.name): - self._hosts.append(device.name) - self._num_cores_per_host = tpu_system_metadata.num_of_cores_per_host - self._num_cores = tpu_system_metadata.num_cores - - _validate_batch_size(self._batch_size, self._num_cores) - self._batch_size_per_core = self._batch_size // self._num_cores - - # TODO(shizhiw): remove `mode`? - if mode == TRAINING: - _validate_optimization_parameters(optimization_parameters, - self._table_to_config_dict) - self._optimization_parameters = optimization_parameters - elif mode == INFERENCE: - if optimization_parameters is not None: - raise ValueError(f'`optimization_parameters` should be `None` ' - f'for inference mode. ' - f'Received: {optimization_parameters}.') - self._optimization_parameters = (StochasticGradientDescentParameters(1.)) - else: - raise ValueError('`mode` only supports {} and {}; got {}.'.format( - TRAINING, INFERENCE, mode)) - self._mode = mode - - # TODO(shizhiw): move `optimization_parameters` into `_optimizer_handler` - # and create special handler for inference that inherits from - # StochasticGradientDescentHandler with more user-friendly error message - # on get_slot(). - self._optimizer_handler_dict = self._get_optimizer_handler_by_table() - - self._pipeline_execution_with_tensor_core = ( - pipeline_execution_with_tensor_core) - self._learning_rate_fn = list( - set(c.learning_rate_fn - for c in self._table_to_config_dict.values() - if c.learning_rate_fn is not None)) - self._learning_rate_fn_to_tag = { - fn: id for id, fn in enumerate(self._learning_rate_fn) - } - - self._config_proto = self._create_config_proto() - - @property - def hosts(self): - """A list of device names for CPU hosts. - - Returns: - A list of device names for CPU hosts. - """ - return copy.copy(self._hosts) - - # TODO(shizhiw): change to num_tensor_cores_per_host to be more explicit and - # to be consistent with `tpu_embedding_configuration.proto`. - @property - def num_cores_per_host(self): - """Number of TPU cores on a CPU host. - - Returns: - Number of TPU cores on a CPU host. - """ - return self._num_cores_per_host - - @property - def num_cores(self): - """Total number of TPU cores on all hosts. - - Returns: - Total number of TPU cores on all hosts. - """ - return self._num_cores - - @property - def batch_size_per_core(self): - """Batch size for each TPU core. - - The sparse tensors in `sparse_features_list` to `generate_enqueue_ops` - must have batch dimension equal to this. - - Returns: - Batch size for each TPU core. - """ - return self._batch_size_per_core - - @property - def config_proto(self): - """Create embedding config proto for `tpu.initialize_system()`. - - Returns: - an `TPUEmbeddingConfiguration` proto describing the desired - configuration of the hardware embedding lookup tables, which - is passed to `tpu.initialize_system()`. - """ - return self._config_proto - - @property - def table_to_config_dict(self): - return copy.copy(self._table_to_config_dict) - - @property - def feature_to_config_dict(self): - return copy.copy(self._feature_to_config_dict) - - @property - def table_to_features_dict(self): - return copy.copy(self._table_to_features_dict) - - @property - def optimization_parameters(self): - return self._optimization_parameters - - def _create_config_proto(self): - """Create `TPUEmbeddingConfiguration`.""" - config_proto = elc.TPUEmbeddingConfiguration() - for table in self._table_to_config_dict: - table_descriptor = config_proto.table_descriptor.add() - table_descriptor.name = table - - table_config = self._table_to_config_dict[table] - # For small tables, we pad to the number of hosts so that at least one - # id will be assigned to each host. - table_descriptor.vocabulary_size = max(table_config.vocabulary_size, - len(self.hosts)) - table_descriptor.dimension = table_config.dimension - - optimization_parameters = ( - self._optimizer_handler_dict[table].get_optimization_parameters()) - - parameters = table_descriptor.optimization_parameters - if table_config.learning_rate: - parameters.learning_rate.constant = table_config.learning_rate - elif table_config.learning_rate_fn: - parameters.learning_rate.dynamic.tag = ( - self._learning_rate_fn_to_tag[table_config.learning_rate_fn]) - else: - parameters.learning_rate.constant = ( - optimization_parameters.learning_rate) - parameters.gradient_accumulation_status = ( - optimization_parameters_pb2.GradientAccumulationStatus.ENABLED - if optimization_parameters.use_gradient_accumulation else - optimization_parameters_pb2.GradientAccumulationStatus.DISABLED) - - if optimization_parameters.clip_gradient_min is not None: - parameters.gradient_clipping_limits.lower.value = ( - optimization_parameters.clip_gradient_min) - if optimization_parameters.clip_gradient_max is not None: - parameters.gradient_clipping_limits.upper.value = ( - optimization_parameters.clip_gradient_max) - - if optimization_parameters.clip_weight_min is not None: - parameters.clipping_limits.lower.value = ( - optimization_parameters.clip_weight_min) - if optimization_parameters.clip_weight_max is not None: - parameters.clipping_limits.upper.value = ( - optimization_parameters.clip_weight_max) - if optimization_parameters.weight_decay_factor: - parameters.weight_decay_factor = ( - optimization_parameters.weight_decay_factor) - if (optimization_parameters - .multiply_weight_decay_factor_by_learning_rate): - parameters.multiply_weight_decay_factor_by_learning_rate = True - if table_config.hot_id_replication: - parameters.hot_id_replication_configuration.status = ( - optimization_parameters_pb2.HotIdReplicationConfiguration.ENABLED) - optimizer_handler = self._optimizer_handler_dict[table] - optimizer_handler.set_optimization_parameters(table_descriptor) - - table_to_id = { - table: i for i, table in enumerate(self._table_to_config_dict) - } - - # Set feature descriptor field in the config proto. - for table in self._table_to_features_dict: - features = self._table_to_features_dict[table] - for feature in features: - feature_descriptor = config_proto.feature_descriptor.add() - - feature_descriptor.table_id = table_to_id[ - self._feature_to_config_dict[feature].table_id] - if self._feature_to_config_dict[feature].max_sequence_length > 0: - feature_descriptor.input_shape.extend([ - self._batch_size_per_core, - self._feature_to_config_dict[feature].max_sequence_length - ]) - else: - feature_descriptor.input_shape.extend([self._batch_size_per_core]) - - config_proto.mode = self._mode - config_proto.num_hosts = self._num_hosts - config_proto.num_tensor_cores = self._num_cores - config_proto.sharding_strategy = ( - elc.TPUEmbeddingConfiguration.DIV_DEFAULT if self._partition_strategy - == 'div' else elc.TPUEmbeddingConfiguration.MOD) - config_proto.pipeline_execution_with_tensor_core = ( - self._pipeline_execution_with_tensor_core) - if self._profile_data_directory: - config_proto.profile_data_directory = self._profile_data_directory - - return config_proto - - def create_variables_and_ops(self, - embedding_variable_name_by_table=None, - slot_variable_names_by_table=None): - """Create embedding and slot variables, with ops to load and retrieve them. - - N.B.: the retrieve embedding variables (including slot variables) ops are - returned as lambda fn, as the call side might want to impose control - dependencies between the TPU computation and retrieving actions. For - example, the following code snippet ensures the TPU computation finishes - first, and then we pull the variables back from TPU to CPU. - - ``` - updates_ops = [] - with ops.control_dependencies([loss]): - for op_fn in retrieve_parameters_op_fns: - update_ops.append(op_fn()) - ``` - - Args: - embedding_variable_name_by_table: A dictionary mapping from string of - table name to string of embedding variable name. If `None`, defaults - from `get_default_slot_variable_names()` will be used. - slot_variable_names_by_table: A dictionary mapping from string of table - name to `AdamSlotVariableNames`, `AdagradSlotVariableNames` etc. If - `None`, defaults from `get_default_slot_variable_names()` will be used. - - Returns: - `tpu_embedding.VariablesAndOps` with: - A dictionary mapping from string of table name to embedding variables, - A dictionary mapping from string of table name to AdagradSlotVariables, - AdamSlotVariables etc with slot variables, - A function which returns a list of ops to load embedding and slot - variables from CPU to TPU. - A function which returns a list of ops to retrieve embedding and slot - variables from TPU to CPU. - """ - embedding_variables_by_table = {} - slot_variables_by_table = {} - load_op_fns = [] - retrieve_op_fns = [] - - for i, table in enumerate(self._table_to_config_dict): - if embedding_variable_name_by_table: - embedding_variable_name = embedding_variable_name_by_table[table] - else: - embedding_variable_name = table - if slot_variable_names_by_table: - slot_variable_names = slot_variable_names_by_table[table] - else: - optimizer_handler = self._optimizer_handler_dict[table] - slot_variable_names = ( - optimizer_handler.get_default_slot_variable_names(table)) - - # TODO(b/139144091): Multi-host support for mid-level API in - # eager context (TF 2.0) - # Workaround below allows single-host use case in TF 2.0 - if context.executing_eagerly(): - device = '' - else: - device = _create_device_fn(self._hosts) - - with ops.device(device): - table_variables = _create_partitioned_variables( - name=embedding_variable_name, - num_hosts=self._num_hosts, - vocabulary_size=self._table_to_config_dict[table].vocabulary_size, - embedding_dimension=self._table_to_config_dict[table].dimension, - initializer=self._table_to_config_dict[table].initializer, - collections=[ops.GraphKeys.GLOBAL_VARIABLES]) - embedding_variables_by_table[table] = table_variables - - # Only loads embedding config to load/retrieve nodes for the first table - # on the first host, other nodes would use config from the first node. - config = None if i else self.config_proto.SerializeToString() - slot_variables_for_table, load_ops_fn, retrieve_ops_fn = ( - self._optimizer_handler_dict[table].create_variables_and_ops( - table, slot_variable_names, self._num_hosts, - self._table_to_config_dict[table], table_variables, config)) - slot_variables_by_table[table] = slot_variables_for_table - load_op_fns.append(load_ops_fn) - retrieve_op_fns.append(retrieve_ops_fn) - - def load_ops(): - """Calls and returns the load ops for each embedding table. - - Returns: - A list of ops to load embedding and slot variables from CPU to TPU. - """ - load_ops_list = [] - for load_op_fn in load_op_fns: - load_ops_list.extend(load_op_fn()) - return load_ops_list - - def retrieve_ops(): - """Calls and returns the retrieve ops for each embedding table. - - Returns: - A list of ops to retrieve embedding and slot variables from TPU to CPU. - """ - retrieve_ops_list = [] - for retrieve_op_fn in retrieve_op_fns: - retrieve_ops_list.extend(retrieve_op_fn()) - return retrieve_ops_list - - return VariablesAndOps(embedding_variables_by_table, - slot_variables_by_table, load_ops, retrieve_ops) - - def generate_enqueue_ops( - self, - enqueue_datas_list, - mode_override=None, - ragged=False, - ): - """Generate enqueue ops. - - Args: - enqueue_datas_list: a list of dictionary mapping from string of feature - names to EnqueueData. Each dictionary is for one TPU core. Dictionaries - for the same host should be contiguous in the list. - mode_override: A string input that overrides the mode specified in the - TPUEmbeddingConfiguration. Supported values are {'unspecified', - 'inference', 'training', 'backward_pass_only'}. When set to - 'unspecified', the mode set in TPUEmbeddingConfiguration is used, - otherwise mode_override is used (optional). - ragged: If True, creates RaggedTensor enqueue ops rather than - SparseTensor. - - Returns: - Ops to enqueue to TPU for embedding. - """ - self._validate_generate_enqueue_ops_enqueue_datas_list(enqueue_datas_list) - return [ - self._generate_enqueue_op( # pylint: disable=g-complex-comprehension - enqueue_datas, - device_ordinal=i % self._num_cores_per_host, - mode_override=mode_override, - ragged=ragged, - ) for i, enqueue_datas in enumerate(enqueue_datas_list) - ] - - def _validate_generate_enqueue_ops_enqueue_datas_list(self, - enqueue_datas_list): - """Validate `enqueue_datas_list`.""" - - def _check_agreement(data, name, feature, enqueue_data): - """Helper function to check device agreement.""" - if (data is not None and - data.device != enqueue_data.embedding_indices.device): - raise ValueError('Device of {0} does not agree with that of' - 'embedding_indices for feature {1}.'.format( - name, feature)) - - feature_set = set(self._feature_to_config_dict.keys()) - contiguous_device = None - for i, enqueue_datas in enumerate(enqueue_datas_list): - used_feature_set = set(enqueue_datas.keys()) - - # Check features are valid. - missing_feature_set = feature_set - used_feature_set - if missing_feature_set: - raise ValueError('`enqueue_datas_list[{}]` misses a feature that is ' - 'in `feature_to_config_dict`: {}.'.format( - i, missing_feature_set)) - - extra_feature_set = used_feature_set - feature_set - if extra_feature_set: - raise ValueError('`enqueue_datas_list[{}]` has a feature that is not ' - 'in `feature_to_config_dict`: {}.'.format( - i, extra_feature_set)) - - device = None - device_feature = None - for feature, enqueue_data in enqueue_datas.items(): - combiner = self._table_to_config_dict[ - self._feature_to_config_dict[feature].table_id].combiner - - if isinstance(enqueue_data, EnqueueData): - if enqueue_data.sample_indices is None and combiner: - logging.warn( - 'No sample indices set for features %f table %f but ' - 'combiner is set to %s.', feature, - self._feature_to_config_dict[feature].table_id, combiner) - _check_agreement(enqueue_data.sample_indices, 'sample_indices', - feature, enqueue_data) - _check_agreement(enqueue_data.aggregation_weights, - 'aggregation_weights', feature, enqueue_data) - - elif isinstance(enqueue_data, RaggedEnqueueData): - if enqueue_data.row_splits is None and combiner: - logging.warn( - 'No row splits set for features %f table %f but ' - 'combiner is set to %s.', feature, - self._feature_to_config_dict[feature].table_id, combiner) - _check_agreement(enqueue_data.row_splits, 'row_splits', feature, - enqueue_data) - _check_agreement(enqueue_data.aggregation_weights, - 'aggregation_weights', feature, enqueue_data) - else: - raise ValueError( - '`enqueue_datas_list[{}]` has a feature that is not mapped to ' - '`EnqueueData` or `RaggedEnqueueData`. `feature`: {}'.format( - i, feature)) - # Check all features are on the same device. - if device is None: - device = enqueue_data.embedding_indices.device - device_feature = feature - else: - if device != enqueue_data.embedding_indices.device: - raise ValueError('Devices are different between features in ' - '`enqueue_datas_list[{}]`; ' - 'devices: {}, {}; features: {}, {}.'.format( - i, device, - enqueue_data.embedding_indices.device, feature, - device_feature)) - - if i % self._num_cores_per_host: - if device != contiguous_device: - raise ValueError('We expect the `enqueue_datas` which are on the ' - 'same host to be contiguous in ' - '`enqueue_datas_list`, ' - '`enqueue_datas_list[{}]` is on device {}, ' - 'but is expected to be on device {}.'.format( - i, device, contiguous_device)) - else: - contiguous_device = device - - def _generate_enqueue_op(self, - enqueue_datas, - device_ordinal, - mode_override=None, - ragged=False): - """Creates op for enqueuing batch to TPU.""" - enqueue_data0 = list(enqueue_datas.values())[0] - with ops.colocate_with(enqueue_data0.embedding_indices): - return tpu_ops.enqueue_tpu_embedding_arbitrary_tensor_batch( - device_ordinal=device_ordinal, - combiners=self._combiners, - mode_override=mode_override, - **self._format_for_tpu_embedding_arbitrary_tensor_batch( - enqueue_datas, ragged)) - - def _format_for_tpu_embedding_arbitrary_tensor_batch(self, enqueue_datas, - ragged): - """Format features for `enqueue_tpu_embedding_arbitrary_tensor_batch()`. - - Args: - enqueue_datas: a `Dict` of `RaggedEnqueueData` objects for embedding. - ragged: If True, extract row splits from the data rather than sample - indices. - - Returns: - Dict of arguments for `enqueue_tpu_embedding_arbitrary_tensor_batch()`. - """ - - kwargs = { - 'sample_indices_or_row_splits': [], - 'embedding_indices': [], - 'aggregation_weights': [], - } - int_zeros = array_ops.zeros((0,), dtype=dtypes.int64) - float_zeros = array_ops.zeros((0,), dtype=dtypes.float32) - for table in self._table_to_features_dict: - features = self._table_to_features_dict[table] - for feature in features: - enqueue_data = enqueue_datas[feature] - if ragged: - kwargs['sample_indices_or_row_splits'].append( - enqueue_data.row_splits if enqueue_data - .row_splits is not None else int_zeros) - else: - if (self._feature_to_config_dict[feature].max_sequence_length > 0 and - enqueue_data.sample_indices is not None and - enqueue_data.sample_indices.shape[1] == 2): - # Pad the sample indices as if the enqueued sparse tensor is rank 2. - sample_indices = array_ops.pad( - enqueue_data.sample_indices, paddings=[[0, 0], [0, 1]]) - kwargs['sample_indices_or_row_splits'].append(sample_indices) - else: - # If the sample_indices is rank 1 or not present, treat it as dense - # tensor. - if (enqueue_data.sample_indices is None or - enqueue_data.sample_indices.shape[1] == 1): - kwargs['sample_indices_or_row_splits'].append(int_zeros) - else: - kwargs['sample_indices_or_row_splits'].append( - enqueue_data.sample_indices) - - kwargs['aggregation_weights'].append( - enqueue_data.aggregation_weights if enqueue_data - .aggregation_weights is not None else float_zeros) - - kwargs['embedding_indices'].append(enqueue_data.embedding_indices) - return kwargs - - def get_activations(self): - """Get activations for features. - - This should be called within `computation` that is passed to - `tpu.replicate` and friends. - - Returns: - A dictionary mapping from `String` of feature name to `Tensor` - of activation. - """ - recv_activations = tpu_ops.recv_tpu_embedding_activations( - num_outputs=len(self._feature_to_config_dict), - config=self._config_proto.SerializeToString()) - - activations = collections.OrderedDict() - index = 0 - for table in self._table_to_features_dict: - for feature in self._table_to_features_dict[table]: - activations[feature] = recv_activations[index] - index += 1 - return activations - - def generate_send_gradients_op(self, feature_to_gradient_dict, step=None): - """Send gradient to TPU embedding. - - Args: - feature_to_gradient_dict: dict mapping feature names to gradient wrt - activations. - step: the current global step, used for dynamic learning rate. - - Returns: - SendTPUEmbeddingGradients Op. - - Raises: - RuntimeError: If `mode` is not `TRAINING`. - """ - if self._mode != TRAINING: - raise RuntimeError('Only in training mode gradients need to ' - 'be sent to TPU embedding; got mode {}.'.format( - self._mode)) - if step is None and self._learning_rate_fn: - raise ValueError('There are dynamic learning rates but step is None.') - - gradients = [] - for table in self._table_to_features_dict: - for feature in self._table_to_features_dict[table]: - gradients.append(feature_to_gradient_dict[feature]) - - return tpu_ops.send_tpu_embedding_gradients( - inputs=gradients, - learning_rates=[ - math_ops.cast(fn(step), dtype=dtypes.float32) - for fn in self._learning_rate_fn - ], - config=self.config_proto.SerializeToString()) - - def _get_optimizer_handler_by_table(self): - optimizer_handlers = {} - for table, table_config in self.table_to_config_dict.items(): - if table_config.optimization_parameters is not None: - optimizer = table_config.optimization_parameters - else: - optimizer = self._optimization_parameters - optimizer_handlers[table] = _get_optimization_handler(optimizer) - - return optimizer_handlers - - -def _validate_table_to_config_dict(table_to_config_dict): - """Validate `table_to_config_dict`.""" - for k, v in table_to_config_dict.items(): - if not isinstance(v, TableConfig): - raise ValueError('Value of `table_to_config_dict` must be of type ' - '`TableConfig`, got {} for {}.'.format(type(v), k)) - - -def _validate_feature_to_config_dict(table_to_config_dict, - feature_to_config_dict): - """Validate `feature_to_config_dict`.""" - used_table_set = set( - [feature.table_id for feature in feature_to_config_dict.values()]) - table_set = set(table_to_config_dict.keys()) - - unused_table_set = table_set - used_table_set - if unused_table_set: - raise ValueError( - '`table_to_config_dict` specifies table that is not ' - 'used in `feature_to_config_dict`: {}.'.format(unused_table_set)) - - extra_table_set = used_table_set - table_set - if extra_table_set: - raise ValueError( - '`feature_to_config_dict` refers to a table that is not ' - 'specified in `table_to_config_dict`: {}.'.format(extra_table_set)) - - -def _validate_batch_size(batch_size, num_cores): - if batch_size % num_cores: - raise ValueError('`batch_size` is not a multiple of number of ' - 'cores. `batch_size`={}, `_num_cores`={}.'.format( - batch_size, num_cores)) - - -def _validate_optimization_parameters(optimization_parameters, - table_to_config_dict): - """Validate global optimization_parameters and per table optimizers. - - If global optimizer is `None`, all table optimizers should be non `None`. - - Args: - optimization_parameters: global optimizer provided in `TPUEmbedding` - constructor. - table_to_config_dict: A dictionary mapping from string of table name to - `TableConfig`. - """ - tbl_optimizer_missing = False - for _, table_config in table_to_config_dict.items(): - if table_config.optimization_parameters is None: - tbl_optimizer_missing = True - break - - if optimization_parameters: - if not isinstance(optimization_parameters, _OptimizationParameters): - raise ValueError('`optimization_parameters` must inherit from ' - '`_OptimizationParameters`. ' - '`type(optimization_parameters)`={}'.format( - type(optimization_parameters))) - else: - # Missing global optimization_parameters. - if tbl_optimizer_missing: - raise ValueError('`optimization_parameters` is missing.') - - -class _OptimizerHandler: - """Interface class for handling optimizer specific logic.""" - - def __init__(self, optimization_parameters): - self._optimization_parameters = optimization_parameters - - def get_optimization_parameters(self): - return self._optimization_parameters - - def set_optimization_parameters(self, table_descriptor): - raise NotImplementedError() - - def get_default_slot_variable_names(self, table): - raise NotImplementedError() - - def create_variables_and_ops(self, table, slot_variable_names, num_hosts, - table_config, table_variables, config_proto): - raise NotImplementedError() - - -class _AdagradHandler(_OptimizerHandler): - """Handles Adagrad specific logic.""" - - def set_optimization_parameters(self, table_descriptor): - table_descriptor.optimization_parameters.adagrad.SetInParent() - - def get_default_slot_variable_names(self, table): - return AdagradSlotVariableNames('{}/{}'.format(table, 'Adagrad')) - - def create_variables_and_ops(self, table, slot_variable_names, num_hosts, - table_config, table_variables, config_proto): - accumulator_initializer = init_ops.constant_initializer( - self._optimization_parameters.initial_accumulator) - accumulator_variables = _create_partitioned_variables( - name=slot_variable_names.accumulator, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=accumulator_initializer) - slot_variables = AdagradSlotVariables(accumulator_variables) - - def load_ops_fn(): - """Returns the retrieve ops for AdaGrad embedding tables. - - Returns: - A list of ops to load embedding and slot variables from CPU to TPU. - """ - config = config_proto - load_op_list = [] - for host_id, table_variable, accumulator_variable in zip( - range(num_hosts), table_variables, accumulator_variables): - with ops.colocate_with(table_variable): - load_parameters_op = ( - tpu_ops.load_tpu_embedding_adagrad_parameters( - parameters=table_variable, - accumulators=accumulator_variable, - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - config = None - load_op_list.append(load_parameters_op) - return load_op_list - - def retrieve_ops_fn(): - """Returns the retrieve ops for AdaGrad embedding tables. - - Returns: - A list of ops to retrieve embedding and slot variables from TPU to CPU. - """ - config = config_proto - retrieve_op_list = [] - for host_id, table_variable, accumulator_variable in (zip( - range(num_hosts), table_variables, accumulator_variables)): - with ops.colocate_with(table_variable): - retrieved_table, retrieved_accumulator = ( - tpu_ops.retrieve_tpu_embedding_adagrad_parameters( - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - retrieve_parameters_op = control_flow_ops.group( - state_ops.assign(table_variable, retrieved_table), - state_ops.assign(accumulator_variable, retrieved_accumulator)) - config = None - retrieve_op_list.append(retrieve_parameters_op) - return retrieve_op_list - - return slot_variables, load_ops_fn, retrieve_ops_fn - - -class _AdagradMomentumHandler(_OptimizerHandler): - """Handles Adagrad with Momentum specific logic. - - Creates slot variables and defines their initializers. Defines load/retrieve - operations to be used for loading variables into TPU memory (from host memory) - and retrieving variables from TPU memory (into host memory). - """ - - def set_optimization_parameters(self, table_descriptor): - table_descriptor.optimization_parameters.adagrad_momentum.SetInParent() - table_descriptor.optimization_parameters.adagrad_momentum.momentum = ( - self._optimization_parameters.momentum) - table_descriptor.optimization_parameters.adagrad_momentum.use_nesterov = ( - self._optimization_parameters.use_nesterov) - table_descriptor.optimization_parameters.adagrad_momentum.exponent = ( - self._optimization_parameters.exponent) - table_descriptor.optimization_parameters.adagrad_momentum.beta2 = ( - self._optimization_parameters.beta2) - table_descriptor.optimization_parameters.adagrad_momentum.epsilon = ( - self._optimization_parameters.epsilon) - - def get_default_slot_variable_names(self, table): - return AdagradMomentumSlotVariableNames( - '{}/{}/Accumulator'.format(table, 'AdagradMomentum'), - '{}/{}/Momentum'.format(table, 'AdagradMomentum')) - - def create_variables_and_ops(self, table, slot_variable_names, num_hosts, - table_config, table_variables, config_proto): - accumulator_initializer = init_ops.zeros_initializer() - accumulator_variables = _create_partitioned_variables( - name=slot_variable_names.accumulator, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=accumulator_initializer) - momenta_initializer = init_ops.zeros_initializer() - momenta_variables = _create_partitioned_variables( - name=slot_variable_names.momenta, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=momenta_initializer) - slot_variables = AdagradMomentumSlotVariables(accumulator_variables, - momenta_variables) - - def load_ops_fn(): - """Returns the load ops for AdaGrad with momentum embedding tables. - - Returns: - A list of ops to load embedding and slot variables from CPU to TPU. - """ - config = config_proto - load_op_list = [] - for host_id, table_variable, accumulator_variable, momenta_variable in zip( - range(num_hosts), table_variables, accumulator_variables, - momenta_variables): - with ops.colocate_with(table_variable): - load_parameters_op = ( - tpu_ops.load_tpu_embedding_adagrad_momentum_parameters( - parameters=table_variable, - accumulators=accumulator_variable, - momenta=momenta_variable, - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - config = None - load_op_list.append(load_parameters_op) - return load_op_list - - def retrieve_ops_fn(): - """Returns the retrieve ops for AdaGrad with momentum embedding tables. - - Returns: - A list of ops to retrieve embedding and slot variables from TPU to CPU. - """ - config = config_proto - retrieve_op_list = [] - for host_id, table_variable, accumulator_variable, momenta_variable in ( - zip( - range(num_hosts), table_variables, accumulator_variables, - momenta_variables)): - with ops.colocate_with(table_variable): - retrieved_table, retrieved_accumulator, retrieved_momenta = ( - tpu_ops.retrieve_tpu_embedding_adagrad_momentum_parameters( - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - retrieve_parameters_op = control_flow_ops.group( - state_ops.assign(table_variable, retrieved_table), - state_ops.assign(accumulator_variable, retrieved_accumulator), - state_ops.assign(momenta_variable, retrieved_momenta)) - config = None - retrieve_op_list.append(retrieve_parameters_op) - return retrieve_op_list - - return slot_variables, load_ops_fn, retrieve_ops_fn - - -class _ProximalAdagradHandler(_OptimizerHandler): - """Handles ProximalAdagrad specific logic.""" - - def set_optimization_parameters(self, table_descriptor): - table_descriptor.optimization_parameters.proximal_adagrad.SetInParent() - table_descriptor.optimization_parameters.proximal_adagrad.l1 = ( - self._optimization_parameters.l1_regularization_strength) - table_descriptor.optimization_parameters.proximal_adagrad.l2 = ( - self._optimization_parameters.l2_regularization_strength) - - def get_default_slot_variable_names(self, table): - return ProximalAdagradSlotVariableNames('{}/{}'.format( - table, 'ProximalAdagrad')) - - def create_variables_and_ops(self, table, slot_variable_names, num_hosts, - table_config, table_variables, config_proto): - accumulator_initializer = init_ops.constant_initializer( - self._optimization_parameters.initial_accumulator) - accumulator_variables = _create_partitioned_variables( - name=slot_variable_names.accumulator, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=accumulator_initializer) - slot_variables = ProximalAdagradSlotVariables(accumulator_variables) - - def load_ops_fn(): - """Returns the retrieve ops for Proximal AdaGrad embedding tables. - - Returns: - A list of ops to load embedding and slot variables from CPU to TPU. - """ - config = config_proto - load_op_list = [] - for host_id, table_variable, accumulator_variable in zip( - range(num_hosts), table_variables, accumulator_variables): - with ops.colocate_with(table_variable): - load_parameters_op = ( - tpu_ops.load_tpu_embedding_proximal_adagrad_parameters( - parameters=table_variable, - accumulators=accumulator_variable, - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - config = None - load_op_list.append(load_parameters_op) - return load_op_list - - def retrieve_ops_fn(): - """Returns the retrieve ops for Proximal AdaGrad embedding tables. - - Returns: - A list of ops to retrieve embedding and slot variables from TPU to CPU. - """ - config = config_proto - retrieve_op_list = [] - for host_id, table_variable, accumulator_variable in (zip( - range(num_hosts), table_variables, accumulator_variables)): - with ops.colocate_with(table_variable): - retrieved_table, retrieved_accumulator = ( - tpu_ops.retrieve_tpu_embedding_proximal_adagrad_parameters( - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - retrieve_parameters_op = control_flow_ops.group( - state_ops.assign(table_variable, retrieved_table), - state_ops.assign(accumulator_variable, retrieved_accumulator)) - config = None - retrieve_op_list.append(retrieve_parameters_op) - return retrieve_op_list - - return slot_variables, load_ops_fn, retrieve_ops_fn - - -class _AdamHandler(_OptimizerHandler): - """Handles Adam specific logic.""" - - def set_optimization_parameters(self, table_descriptor): - table_descriptor.optimization_parameters.adam.beta1 = ( - self._optimization_parameters.beta1) - table_descriptor.optimization_parameters.adam.beta2 = ( - self._optimization_parameters.beta2) - table_descriptor.optimization_parameters.adam.epsilon = ( - self._optimization_parameters.epsilon) - table_descriptor.optimization_parameters.adam.use_non_lazy_adam = ( - not self._optimization_parameters.lazy_adam) - table_descriptor.optimization_parameters.adam.use_sum_inside_sqrt = ( - self._optimization_parameters.sum_inside_sqrt) - - def get_default_slot_variable_names(self, table): - return AdamSlotVariableNames('{}/{}/m'.format(table, 'Adam'), - '{}/{}/v'.format(table, 'Adam')) - - def create_variables_and_ops(self, table, slot_variable_names, num_hosts, - table_config, table_variables, config_proto): - m_initializer = init_ops.zeros_initializer() - m_variables = _create_partitioned_variables( - name=slot_variable_names.m, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=m_initializer) - v_initializer = init_ops.zeros_initializer() - v_variables = _create_partitioned_variables( - name=slot_variable_names.v, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=v_initializer) - slot_variables = AdamSlotVariables(m_variables, v_variables) - - def load_ops_fn(): - """Returns the retrieve ops for AdaGrad embedding tables. - - Returns: - A list of ops to load embedding and slot variables from CPU to TPU. - """ - load_op_list = [] - config = config_proto - for host_id, table_variable, m_variable, v_variable in (zip( - range(num_hosts), table_variables, m_variables, v_variables)): - with ops.colocate_with(table_variable): - load_parameters_op = ( - tpu_ops.load_tpu_embedding_adam_parameters( - parameters=table_variable, - momenta=m_variable, - velocities=v_variable, - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - # Set config to None to enforce that config is only loaded to the first - # table. - config = None - load_op_list.append(load_parameters_op) - return load_op_list - - def retrieve_ops_fn(): - """Returns the retrieve ops for Adam embedding tables. - - Returns: - A list of ops to retrieve embedding and slot variables from TPU to CPU. - """ - retrieve_op_list = [] - config = config_proto - for host_id, table_variable, m_variable, v_variable in (zip( - range(num_hosts), table_variables, m_variables, v_variables)): - with ops.colocate_with(table_variable): - retrieved_table, retrieved_m, retrieved_v = ( - tpu_ops.retrieve_tpu_embedding_adam_parameters( - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - retrieve_parameters_op = control_flow_ops.group( - state_ops.assign(table_variable, retrieved_table), - state_ops.assign(m_variable, retrieved_m), - state_ops.assign(v_variable, retrieved_v)) - config = None - retrieve_op_list.append(retrieve_parameters_op) - return retrieve_op_list - - return slot_variables, load_ops_fn, retrieve_ops_fn - - -class _FtrlHandler(_OptimizerHandler): - """Handles Ftrl specific logic.""" - - def set_optimization_parameters(self, table_descriptor): - table_descriptor.optimization_parameters.ftrl.lr_power = ( - self._optimization_parameters.learning_rate_power) - table_descriptor.optimization_parameters.ftrl.l1 = ( - self._optimization_parameters.l1_regularization_strength) - table_descriptor.optimization_parameters.ftrl.l2 = ( - self._optimization_parameters.l2_regularization_strength) - table_descriptor.optimization_parameters.ftrl.multiply_linear_by_lr = ( - self._optimization_parameters.multiply_linear_by_learning_rate) - table_descriptor.optimization_parameters.ftrl.beta = ( - self._optimization_parameters.beta) - table_descriptor.optimization_parameters.ftrl.allow_zero_accumulator = ( - self._optimization_parameters.allow_zero_accumulator) - - def get_default_slot_variable_names(self, table): - # These match the default slot variable names created by - # tf.train.FtrlOptimizer. - return FtrlSlotVariableNames( - '{}/{}'.format(table, 'Ftrl'), # accumulator - '{}/{}'.format(table, 'Ftrl_1')) # linear - - def create_variables_and_ops(self, table, slot_variable_names, num_hosts, - table_config, table_variables, config_proto): - accumulator_initializer = init_ops.constant_initializer( - self._optimization_parameters.initial_accumulator_value) - accumulator_variables = _create_partitioned_variables( - name=slot_variable_names.accumulator, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=accumulator_initializer) - linear_initializer = init_ops.constant_initializer( - self._optimization_parameters.initial_linear_value) - linear_variables = _create_partitioned_variables( - name=slot_variable_names.linear, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=linear_initializer) - slot_variables = FtrlSlotVariable(accumulator_variables, linear_variables) - - def load_ops_fn(): - """Returns the retrieve ops for Ftrl embedding tables. - - Returns: - A list of ops to load embedding and slot variables from CPU to TPU. - """ - config = config_proto - load_op_list = [] - for host_id, table_variable, accumulator_variable, linear_variable in zip( - range(num_hosts), table_variables, accumulator_variables, - linear_variables): - with ops.colocate_with(table_variable): - load_parameters_op = ( - tpu_ops.load_tpu_embedding_ftrl_parameters( - parameters=table_variable, - accumulators=accumulator_variable, - linears=linear_variable, - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - config = None - load_op_list.append(load_parameters_op) - return load_op_list - - def retrieve_ops_fn(): - """Returns the retrieve ops for Ftrl embedding tables. - - Returns: - A list of ops to retrieve embedding and slot variables from TPU to CPU. - """ - config = config_proto - retrieve_op_list = [] - for host_id, table_variable, accumulator_variable, linear_variable in zip( - range(num_hosts), table_variables, accumulator_variables, - linear_variables): - with ops.colocate_with(table_variable): - retrieved_table, retrieved_accumulator, retrieved_linear = ( - tpu_ops.retrieve_tpu_embedding_ftrl_parameters( - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - retrieve_parameters_op = control_flow_ops.group( - state_ops.assign(table_variable, retrieved_table), - state_ops.assign(accumulator_variable, retrieved_accumulator), - state_ops.assign(linear_variable, retrieved_linear)) - config = None - retrieve_op_list.append(retrieve_parameters_op) - return retrieve_op_list - - return slot_variables, load_ops_fn, retrieve_ops_fn - - -class _ProximalYogiHandler(_OptimizerHandler): - """Handles Proximal Yogi specific logic.""" - - def set_optimization_parameters(self, table_descriptor): - table_descriptor.optimization_parameters.proximal_yogi.SetInParent() - table_descriptor.optimization_parameters.proximal_yogi.beta1 = ( - self._optimization_parameters.beta1) - table_descriptor.optimization_parameters.proximal_yogi.beta2 = ( - self._optimization_parameters.beta2) - table_descriptor.optimization_parameters.proximal_yogi.epsilon = ( - self._optimization_parameters.epsilon) - table_descriptor.optimization_parameters.proximal_yogi.l1 = ( - self._optimization_parameters.l1_regularization_strength) - table_descriptor.optimization_parameters.proximal_yogi.l2 = ( - self._optimization_parameters.l2_regularization_strength) - - def get_default_slot_variable_names(self, table): - return ProximalYogiSlotVariableNames( - '{}/{}'.format(table, 'ProximalYogi'), # v - '{}/{}_1'.format(table, 'ProximalYogi')) # m - - def create_variables_and_ops(self, table, slot_variable_names, num_hosts, - table_config, table_variables, config_proto): - v_initializer = init_ops.constant_initializer( - self._optimization_parameters.initial_accumulator_value) - v_variables = _create_partitioned_variables( - name=slot_variable_names.v, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=v_initializer) - m_initializer = init_ops.zeros_initializer() - m_variables = _create_partitioned_variables( - name=slot_variable_names.m, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=m_initializer) - slot_variables = ProximalYogiSlotVariables(v_variables, m_variables) - - def load_ops_fn(): - """Returns the load ops for Proximal Yogi embedding tables. - - Returns: - A list of ops to load embedding and slot variables from CPU to TPU. - """ - load_op_list = [] - config = config_proto - for host_id, table_variable, v_variable, m_variable in (zip( - range(num_hosts), table_variables, v_variables, m_variables)): - with ops.colocate_with(table_variable): - load_parameters_op = ( - tpu_ops.load_tpu_embedding_proximal_yogi_parameters( - parameters=table_variable, - v=v_variable, - m=m_variable, - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - # Set config to None to enforce that config is only loaded to the first - # table. - config = None - load_op_list.append(load_parameters_op) - return load_op_list - - def retrieve_ops_fn(): - """Returns the retrieve ops for Proximal Yogi embedding tables. - - Returns: - A list of ops to retrieve embedding and slot variables from TPU to CPU. - """ - retrieve_op_list = [] - config = config_proto - for host_id, table_variable, v_variable, m_variable in (zip( - range(num_hosts), table_variables, v_variables, m_variables)): - with ops.colocate_with(table_variable): - retrieved_table, retrieved_v, retrieved_m = ( - tpu_ops.retrieve_tpu_embedding_proximal_yogi_parameters( - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - retrieve_parameters_op = control_flow_ops.group( - state_ops.assign(table_variable, retrieved_table), - state_ops.assign(v_variable, retrieved_v), - state_ops.assign(m_variable, retrieved_m)) - config = None - retrieve_op_list.append(retrieve_parameters_op) - return retrieve_op_list - - return slot_variables, load_ops_fn, retrieve_ops_fn - - -class _MomentumHandler(_OptimizerHandler): - """Handles Momentum specific logic.""" - - def set_optimization_parameters(self, table_descriptor): - (table_descriptor.optimization_parameters.momentum.SetInParent()) - table_descriptor.optimization_parameters.momentum.momentum = ( - self._optimization_parameters.momentum) - table_descriptor.optimization_parameters.momentum.use_nesterov = ( - self._optimization_parameters.use_nesterov) - - def get_default_slot_variable_names(self, table): - return MomentumSlotVariableNames('{}/{}'.format(table, 'Momentum')) - - def create_variables_and_ops(self, table, slot_variable_names, num_hosts, - table_config, table_variables, config_proto): - - momenta_initializer = init_ops.zeros_initializer() - momenta_variables = _create_partitioned_variables( - name=slot_variable_names.momenta, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=momenta_initializer) - slot_variables = MomentumSlotVariables(momenta_variables) - - def load_ops_fn(): - """Returns the retrieve ops for Momentum embedding tables. - - Returns: - A list of ops to load embedding and slot variables from CPU to TPU. - """ - load_op_list = [] - config = config_proto - for host_id, table_variable, momenta_variable in (zip( - range(num_hosts), table_variables, momenta_variables)): - with ops.colocate_with(table_variable): - load_parameters_op = tpu_ops.load_tpu_embedding_momentum_parameters( - parameters=table_variable, - momenta=momenta_variable, - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config, - ) - config = None - load_op_list.append(load_parameters_op) - return load_op_list - - def retrieve_ops_fn(): - """Returns the retrieve ops for Momentum embedding tables. - - Returns: - A list of ops to retrieve embedding and slot variables from TPU to CPU. - """ - retrieve_op_list = [] - config = config_proto - for host_id, table_variable, momenta_variable in (zip( - range(num_hosts), table_variables, momenta_variables)): - with ops.colocate_with(table_variable): - retrieved_table, retrieved_momenta = ( - tpu_ops.retrieve_tpu_embedding_momentum_parameters( - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config, - )) - retrieve_parameters_op = control_flow_ops.group( - state_ops.assign(table_variable, retrieved_table), - state_ops.assign(momenta_variable, retrieved_momenta)) - config = None - retrieve_op_list.append(retrieve_parameters_op) - return retrieve_op_list - - return slot_variables, load_ops_fn, retrieve_ops_fn - - -class _RMSPropHandler(_OptimizerHandler): - """Handles RMS prop specific logic.""" - - def set_optimization_parameters(self, table_descriptor): - (table_descriptor.optimization_parameters.rms_prop.SetInParent()) - table_descriptor.optimization_parameters.rms_prop.rho = ( - self._optimization_parameters.rho) - table_descriptor.optimization_parameters.rms_prop.epsilon = ( - self._optimization_parameters.epsilon) - table_descriptor.optimization_parameters.rms_prop.momentum = ( - self._optimization_parameters.momentum) - - def get_default_slot_variable_names(self, table): - return RMSPropSlotVariableNames('{}/{}/ms'.format(table, 'RMSProp'), - '{}/{}/mom'.format(table, 'RMSProp')) - - def create_variables_and_ops(self, table, slot_variable_names, num_hosts, - table_config, table_variables, config_proto): - - ms_variables = _create_partitioned_variables( - name=slot_variable_names.ms, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=init_ops.zeros_initializer(), - ) - mom_variables = _create_partitioned_variables( - name=slot_variable_names.mom, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=init_ops.zeros_initializer(), - ) - slot_variables = RMSPropSlotVariables(ms_variables, mom_variables) - - def load_ops_fn(): - """Returns the retrieve ops for RMS Prop embedding tables. - - Returns: - A list of ops to load embedding and slot variables from CPU to TPU. - """ - load_op_list = [] - config = config_proto - for host_id, table_variable, ms_variable, mom_variable in (zip( - range(num_hosts), table_variables, ms_variables, mom_variables)): - with ops.colocate_with(table_variable): - load_parameters_op = tpu_ops.load_tpu_embedding_rms_prop_parameters( - parameters=table_variable, - ms=ms_variable, - mom=mom_variable, - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config, - ) - config = None - load_op_list.append(load_parameters_op) - return load_op_list - - def retrieve_ops_fn(): - """Returns the retrieve ops for RMS Prop embedding tables. - - Returns: - A list of ops to retrieve embedding and slot variables from TPU to CPU. - """ - retrieve_op_list = [] - config = config_proto - for host_id, table_variable, ms_variable, mom_variable in (zip( - range(num_hosts), table_variables, ms_variables, mom_variables)): - with ops.colocate_with(table_variable): - retrieved_table, retrieved_ms, retrieved_mom = ( - tpu_ops.retrieve_tpu_embedding_rms_prop_parameters( - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config, - )) - retrieve_parameters_op = control_flow_ops.group( - state_ops.assign(table_variable, retrieved_table), - state_ops.assign(ms_variable, retrieved_ms), - state_ops.assign(mom_variable, retrieved_mom)) - config = None - retrieve_op_list.append(retrieve_parameters_op) - return retrieve_op_list - - return slot_variables, load_ops_fn, retrieve_ops_fn - - -class _FrequencyEstimatorHandler(_OptimizerHandler): - """Handles frequency estimator specific logic.""" - - def set_optimization_parameters(self, table_descriptor): - table_descriptor.optimization_parameters.frequency_estimator.SetInParent() - freq = table_descriptor.optimization_parameters.frequency_estimator - freq.tau = self._optimization_parameters.tau - freq.max_delta = self._optimization_parameters.max_delta - freq.outlier_threshold = self._optimization_parameters.outlier_threshold - freq.weight_exponent = self._optimization_parameters.weight_exponent - - def get_default_slot_variable_names(self, table): - return FrequencyEstimatorSlotVariableNames( - '{}/FrequencyEstimator'.format(table)) - - def create_variables_and_ops(self, table, slot_variable_names, num_hosts, - table_config, table_variables, config_proto): - if table_config.dimension != 1: - raise ValueError('FrequencyEstimator tables should only have a dimension ' - 'of 1. Received dimension {}'.format( - table_config.dimension)) - - last_hit_step_variables = _create_partitioned_variables( - name=slot_variable_names.last_hit_step, - num_hosts=num_hosts, - vocabulary_size=table_config.vocabulary_size, - embedding_dimension=table_config.dimension, - collections=[ops.GraphKeys.GLOBAL_VARIABLES], - initializer=init_ops.zeros_initializer(), - ) - slot_variables = FrequencyEstimatorSlotVariables(last_hit_step_variables) - - def load_ops_fn(): - """Returns the retrieve ops for Frequency Estimator embedding tables. - - Returns: - A list of ops to load embedding and slot variables from CPU to TPU. - """ - load_op_list = [] - config = config_proto - for host_id, table_variable, last_hit_step_variable in (zip( - range(num_hosts), table_variables, last_hit_step_variables)): - with ops.colocate_with(table_variable): - load_parameters_op = ( - tpu_ops.load_tpu_embedding_frequency_estimator_parameters( - parameters=table_variable, - last_hit_step=last_hit_step_variable, - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - config = None - load_op_list.append(load_parameters_op) - return load_op_list - - def retrieve_ops_fn(): - """Returns the retrieve ops for Frequency Estimator embedding tables. - - Returns: - A list of ops to retrieve embedding and slot variables from TPU to CPU. - """ - retrieve_op_list = [] - config = config_proto - for host_id, table_variable, last_hit_step_variable in (zip( - range(num_hosts), table_variables, last_hit_step_variables)): - with ops.colocate_with(table_variable): - retrieved_table, retrieved_last_hit_step = ( - tpu_ops.retrieve_tpu_embedding_frequency_estimator_parameters( - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config, - )) - retrieve_parameters_op = control_flow_ops.group( - state_ops.assign(table_variable, retrieved_table), - state_ops.assign(last_hit_step_variable, retrieved_last_hit_step)) - config = None - retrieve_op_list.append(retrieve_parameters_op) - return retrieve_op_list - - return slot_variables, load_ops_fn, retrieve_ops_fn - - -class _StochasticGradientDescentHandler(_OptimizerHandler): - """Handles stochastic gradient descent specific logic.""" - - def set_optimization_parameters(self, table_descriptor): - (table_descriptor.optimization_parameters.stochastic_gradient_descent - .SetInParent()) - - def get_default_slot_variable_names(self, table): - return None - - def create_variables_and_ops(self, table, slot_variable_names, num_hosts, - table_config, table_variables, config_proto): - del table_config - - def load_ops_fn(): - """Returns the retrieve ops for AdaGrad embedding tables. - - Returns: - A list of ops to load embedding and slot variables from CPU to TPU. - """ - load_op_list = [] - config = config_proto - for host_id, table_variable in enumerate(table_variables): - with ops.colocate_with(table_variable): - load_parameters_op = ( - tpu_ops.load_tpu_embedding_stochastic_gradient_descent_parameters( - parameters=table_variable, - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - config = None - load_op_list.append(load_parameters_op) - return load_op_list - - def retrieve_ops_fn(): - """Returns the retrieve ops for SGD embedding tables. - - Returns: - A list of ops to retrieve embedding and slot variables from TPU to CPU. - """ - retrieve_op_list = [] - config = config_proto - for host_id, table_variable in enumerate(table_variables): - with ops.colocate_with(table_variable): - retrieved_table = ( - tpu_ops - .retrieve_tpu_embedding_stochastic_gradient_descent_parameters( - table_name=table, - num_shards=num_hosts, - shard_id=host_id, - config=config)) - retrieve_parameters_op = control_flow_ops.group( - state_ops.assign(table_variable, retrieved_table)) - config = None - retrieve_op_list.append(retrieve_parameters_op) - return retrieve_op_list - - return None, load_ops_fn, retrieve_ops_fn - - -def _get_optimization_handler(optimization_parameters): - """Gets the optimization handler given the parameter type.""" - if isinstance(optimization_parameters, AdagradParameters): - return _AdagradHandler(optimization_parameters) - elif isinstance(optimization_parameters, AdagradMomentumParameters): - return _AdagradMomentumHandler(optimization_parameters) - elif isinstance(optimization_parameters, ProximalAdagradParameters): - return _ProximalAdagradHandler(optimization_parameters) - elif isinstance(optimization_parameters, AdamParameters): - return _AdamHandler(optimization_parameters) - elif isinstance(optimization_parameters, FtrlParameters): - return _FtrlHandler(optimization_parameters) - elif isinstance(optimization_parameters, ProximalYogiParameters): - return _ProximalYogiHandler(optimization_parameters) - elif isinstance(optimization_parameters, StochasticGradientDescentParameters): - return _StochasticGradientDescentHandler(optimization_parameters) - elif isinstance(optimization_parameters, MomentumParameters): - return _MomentumHandler(optimization_parameters) - elif isinstance(optimization_parameters, RMSPropParameters): - return _RMSPropHandler(optimization_parameters) - elif isinstance(optimization_parameters, FrequencyEstimatorParameters): - return _FrequencyEstimatorHandler(optimization_parameters) - return NotImplementedError() - - -def _create_ordered_dict(d): - """Create an OrderedDict from Dict.""" - return collections.OrderedDict((k, d[k]) for k in sorted(d)) - - -def _create_combiners(table_to_config_dict, table_to_features_dict): - """Create a per feature list of combiners, ordered by table.""" - combiners = [] - for table in table_to_config_dict: - combiner = table_to_config_dict[table].combiner or 'sum' - combiners.extend([combiner] * len(table_to_features_dict[table])) - return combiners - - -def _create_table_to_features_dict(feature_to_config_dict): - """Create mapping from table to a list of its features.""" - table_to_features_dict_tmp = {} - for feature, feature_config in feature_to_config_dict.items(): - if feature_config.table_id in table_to_features_dict_tmp: - table_to_features_dict_tmp[feature_config.table_id].append(feature) - else: - table_to_features_dict_tmp[feature_config.table_id] = [feature] - - table_to_features_dict = collections.OrderedDict() - for table in sorted(table_to_features_dict_tmp): - table_to_features_dict[table] = sorted(table_to_features_dict_tmp[table]) - return table_to_features_dict - - -def _create_device_fn(hosts): - """Create device_fn() to use with _create_partitioned_variables().""" - - def device_fn(op): - """Returns the `device` for `op`.""" - part_match = re.match(r'.*/part_(\d+)(/|$)', op.name) - dummy_match = re.match(r'.*dummy_(\d+).*', op.name) - if not part_match and not dummy_match: - raise RuntimeError( - 'Internal Error: Expected {} to contain /part_* or dummy_*'.format( - op.name)) - - if part_match: - idx = int(part_match.group(1)) - else: - idx = int(dummy_match.group(1)) # pytype: disable=attribute-error - - device = hosts[idx] - logging.debug('assigning {} to {}.', op, device) - return device - - return device_fn - - -def _create_partitioned_variables(name, - num_hosts, - vocabulary_size, - embedding_dimension, - initializer, - collections=None): # pylint: disable=redefined-outer-name - """Creates PartitionedVariables based on `num_hosts` for `table`.""" - - num_slices = min(vocabulary_size, num_hosts) - - var_list = list( - variable_scope.get_variable( - name, - shape=(vocabulary_size, embedding_dimension), - partitioner=partitioned_variables.fixed_size_partitioner(num_slices), - dtype=dtypes.float32, - initializer=initializer, - collections=collections, - trainable=False)) - - if vocabulary_size >= num_hosts: - return var_list - - # For padded part, define the dummy variable to be loaded into TPU system. - for idx in range(num_hosts - vocabulary_size): - var_list.append( - variable_scope.get_variable( - 'dummy_{}_{}'.format(vocabulary_size + idx, name), - shape=(1, embedding_dimension), - dtype=dtypes.float32, - initializer=initializer, - collections=[ops.GraphKeys.LOCAL_VARIABLES], - trainable=False)) - - return var_list diff --git a/tensorflow/python/tpu/tpu_embedding_gradient.py b/tensorflow/python/tpu/tpu_embedding_gradient.py deleted file mode 100644 index cb272c29634..00000000000 --- a/tensorflow/python/tpu/tpu_embedding_gradient.py +++ /dev/null @@ -1,184 +0,0 @@ -# Copyright 2017 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# =================================================================== -"""Optional helper for gradient handling.""" - -import collections - -from tensorflow.python.framework import dtypes -from tensorflow.python.framework import ops -from tensorflow.python.ops import array_ops -from tensorflow.python.ops import variable_scope -from tensorflow.python.ops import variables -from tensorflow.python.platform import tf_logging as logging -from tensorflow.python.tpu.ops import tpu_ops - - -def get_gradients_through_compute_gradients(optimizer, loss, activations): - """Compute gradients to send to TPU embedding. - - Args: - optimizer: a subclass of optimizer.Optimizer, usually CrossShardOptimizer. - Used to call compute_gradients(). - loss: a Tensor to call optimizer.compute_gradients() on. - activations: an OrderedDict mapping feature_name to Tensors of activations. - - Returns: - An OrderedDict mapping from feature name Strings to Tensors of gradients of - the loss wrt the activations of the features. - """ - activation_list = activations.values() - grads_and_vars = optimizer.compute_gradients(loss, activation_list) - grads = [grad for grad, _ in grads_and_vars] - feature_to_gradient_dict = collections.OrderedDict( - zip(activations.keys(), grads)) - return feature_to_gradient_dict - - -def create_dummy_table_variables(tpu_embedding): - """Create dummy embedding table variables. - - The sole purpose of these dummy variables are to trigger gradient - calculation wrt them so that the gradients wrt activation can be captured - and later sent to TPU embedding. - - Args: - tpu_embedding: TPUEmbedding, dummy table variables will be created for use - with tpu_embedding. - - Returns: - A tuple of dummy variables and their initializer. - - Raises: - RuntimeError: if collection to store gradients already exists and is not - empty. - """ - dummy_table_variables = collections.OrderedDict() - for table_id, table in enumerate(tpu_embedding.table_to_features_dict): - dummy_table_variables[table] = ( - # Explicitly specifying collections prevents this variable from - # being added to the GLOBAL_VARIABLES collection, so that Saver() - # ignores it. - # But Tensorflow optimizer creates slot variable for these dummy - # variable, e.g. tpu_embedding_dummy_table_variable_mlp_user/Adam{_1}, - # which will be in GLOBAL_VARIABLES collection, - variable_scope.get_variable( - 'tpu_embedding_dummy_table_variable_{}'.format(table), - dtype=dtypes.float32, - shape=[1], - use_resource=True, - trainable=True, - collections=['tpu_embedding_dummy_table_variables'])) - - g = ops.get_default_graph() - table_gradients = g.get_collection_ref( - 'tpu_embedding_gradients_table_{}'.format(table_id)) - if table_gradients: - raise RuntimeError( - 'tpu_embedding_gradients_table_{} is not empty.'.format(table_id)) - num_features = len(tpu_embedding.table_to_features_dict[table]) - table_gradients.extend([None for _ in range(num_features)]) - - return (dummy_table_variables, - variables.variables_initializer( - dummy_table_variables.values(), - name='tpu_embedding_dummy_table_variables_init')) - - -def hook_dummy_table_variables_to_activations(tpu_embedding, activations, - dummy_table_variables): - """Have activations depend on dummy table variables for gradient intercept. - - Args: - tpu_embedding: TPUEmbedding, activations and dummy_table_variables are from - tpu_embedding. - activations: An OrderedDict of feature name String to activation tensors. - dummy_table_variables: An OrderedDict of table name String to dummy table - variables. - - Returns: - An OrderedDict of feature name String to activation tensors, which can be - used just as the activations input. - """ - new_activations = collections.OrderedDict() - for feature in activations: - table = tpu_embedding.feature_to_config_dict[feature].table_id - new_activations[feature] = tpu_ops.tpu_embedding_activations( - dummy_table_variables[table], - activations[feature], - table_id=list(tpu_embedding.table_to_config_dict).index(table), - lookup_id=tpu_embedding.table_to_features_dict[table].index(feature)) - return new_activations - - -def get_gradients_through_dummy_table_variables(tpu_embedding): - """Get gradients wrt the activations of each feature. - - Args: - tpu_embedding: TPUEmbedding, create dummy table variable to be used with - tpu_embedding. - - Returns: - An OrderedDict mapping feature name to gradient. - - Raises: - ValueError: if some gradients are not defined. - """ - g = ops.get_default_graph() - gradients_found = False - for table_id, table in enumerate(tpu_embedding.table_to_config_dict): - table_gradients = g.get_collection( - 'tpu_embedding_gradients_table_{}'.format(table_id)) - if any(gradient is None for gradient in table_gradients): - # TODO(bfontain): create a white-list for optimizers which are compatible - # with `tf.stop_gradient`. - logging.warn( - 'Table {} with id {} has undefined gradients: this is probably ' - 'because the model asked TPUEmbedding to compute activations that ' - 'were not used, or tf.stop_gradient() is applied. Gradients of zeros ' - 'are sent back to TPUEmbedding instead. Gradients of zeros and no ' - 'gradients are equivalent for SGD, AdaGrad, FTRL, etc, but ' - 'might differ for other optimizers due to implementation of TPU ' - 'embedding optimizers.'.format(table, table_id)) - gradients_found = gradients_found or any( - gradient is not None for gradient in table_gradients) - - if not gradients_found: - logging.warn( - 'All tables have undefined gradients: this is probably because the ' - 'model asked TPUEmbedding to compute activations that were not used. ' - 'If all TPUEmbedding features have stop_gradients, consider using the ' - 'INFERENCE mode instead.') - - feature_to_gradient_dict = collections.OrderedDict() - for table_id, table in enumerate(tpu_embedding.table_to_config_dict): - table_gradients = g.get_collection( - 'tpu_embedding_gradients_table_{}'.format(table_id)) - for feature, gradient in zip(tpu_embedding.table_to_features_dict[table], - table_gradients): - if gradient is not None: - feature_to_gradient_dict[feature] = gradient - else: - dimension = tpu_embedding.table_to_config_dict[table].dimension - batch_size = tpu_embedding.batch_size_per_core - max_sequence_length = ( - tpu_embedding.feature_to_config_dict[feature].max_sequence_length) - if max_sequence_length: - feature_to_gradient_dict[feature] = array_ops.zeros( - [batch_size, max_sequence_length, dimension]) - else: - feature_to_gradient_dict[feature] = array_ops.zeros( - [batch_size, dimension]) - - return feature_to_gradient_dict diff --git a/tensorflow/python/tpu/tpu_function.py b/tensorflow/python/tpu/tpu_function.py index 357746f1144..c207d63d1dd 100644 --- a/tensorflow/python/tpu/tpu_function.py +++ b/tensorflow/python/tpu/tpu_function.py @@ -43,12 +43,7 @@ _current_tpu_context = TpuContext() def tpu_shard_context(number_of_shards): """A context manager setting current number of shards.""" if _current_tpu_context.number_of_shards is not None: - raise NotImplementedError( - "tpu_shard_context cannot be nested." - "If you're using TPUEstimator with inference_on_tpu, " - "make sure you have set " - "export_saved_model_api_version=ExportSavedModelApiVersion.V2 in " - "the creation of TPUEstimator.") + raise NotImplementedError("tpu_shard_context cannot be nested") try: _current_tpu_context.set_number_of_shards(number_of_shards) yield diff --git a/tensorflow/python/tpu/tpu_optimizer.py b/tensorflow/python/tpu/tpu_optimizer.py index 0140d34aa16..07ad03e05a0 100644 --- a/tensorflow/python/tpu/tpu_optimizer.py +++ b/tensorflow/python/tpu/tpu_optimizer.py @@ -59,9 +59,6 @@ class CrossShardOptimizer(optimizer.Optimizer): f"Keras Optimizer. Received: {opt}. " "If you are using TPUStrategy, " "Keras Optimizer will sum gradients across replicas." - "If you are using TPUEstimator, you may instead sum your gradients " - "with:\n" - "`grads = [tf.compat.v1.tpu.cross_replica_sum(g) for g in grads]`\n" "If you want to average your gradients, rescale your loss with: " "`loss /= global_batch_size`") diff --git a/tensorflow/python/tpu/tpu_replication.py b/tensorflow/python/tpu/tpu_replication.py index f88dd2f192e..a7fc351e804 100644 --- a/tensorflow/python/tpu/tpu_replication.py +++ b/tensorflow/python/tpu/tpu_replication.py @@ -692,12 +692,11 @@ def outside_compilation( For variables placed in TPU device, which includes variables created inside TPUStrategy scope, outside compilation logic must not include variable - read/write. For variables placed on host, which is the case when variables - created via TPUEstimator, variable read/write is only allowed if the variable - is not accessed by any other ops in the TPU computation. Variable read/write - from outside compilation cluster is not visible from TPU computation and - vice versa. Therefore, if outside compilation logic contains such host - variables read/write ops and if the variables are accessed by TPU + read/write. For variables placed on host, variable read/write is only allowed + if the variable is not accessed by any other ops in the TPU computation. + Variable read/write from outside compilation cluster is not visible from TPU + computation and vice versa. Therefore, if outside compilation logic contains + such host variables read/write ops and if the variables are accessed by TPU computation as well, then this may lead to deadlock. Internally, `tf.tpu.outside_compilation()` adds outside compilation diff --git a/tensorflow/python/training/device_setter.py b/tensorflow/python/training/device_setter.py index dc7cfc938c3..4b7e5ac12d4 100644 --- a/tensorflow/python/training/device_setter.py +++ b/tensorflow/python/training/device_setter.py @@ -19,8 +19,6 @@ from tensorflow.python.platform import tf_logging as logging from tensorflow.python.training import server_lib from tensorflow.python.util.tf_export import tf_export -# This is a tuple of PS ops used by tf.estimator.Estimator which should work in -# almost all of cases. STANDARD_PS_OPS = ("Variable", "VariableV2", "AutoReloadVariable", "MutableHashTable", "MutableHashTableV2", "MutableHashTableOfTensors", "MutableHashTableOfTensorsV2", diff --git a/tensorflow/python/training/optimizer.py b/tensorflow/python/training/optimizer.py index aa59f2e343c..7536c6ce906 100644 --- a/tensorflow/python/training/optimizer.py +++ b/tensorflow/python/training/optimizer.py @@ -314,11 +314,10 @@ class Optimizer( (https://www.tensorflow.org/guide/keras/writing_a_training_loop_from_scratch) for examples. - If your TF1 code contains a `tf.compat.v1.train.Optimizer` symbol, whether it - is used with or without a `tf.estimator.Estimator`, you cannot simply replace - that with the corresponding `tf.keras.optimizers.Optimizer`s. To migrate to - TF2, it is advised the whole training program used with `Estimator` to be - migrated to Keras `Model.fit` based or TF2 custom training loops. + If your TF1 code contains a `tf.compat.v1.train.Optimizer` symbol, you cannot + simply replace that with the corresponding `tf.keras.optimizers.Optimizer`s. + To migrate to TF2, it is advised the whole training program to be migrated to + Keras `Model.fit` based, or TF2 custom training loops. #### Structural Mapping to Native TF2 diff --git a/tensorflow/python/training/saver.py b/tensorflow/python/training/saver.py index fd4243e4d30..a2a6f06da94 100644 --- a/tensorflow/python/training/saver.py +++ b/tensorflow/python/training/saver.py @@ -1845,11 +1845,9 @@ def saver_from_object_based_checkpoint(checkpoint_path, "when the checkpoint was written. You can construct a " "Saver(var_list=...) with only the variables which previously " "existed, and if variable names have changed you may need to " - "make this a dictionary with the old names as keys. If you're " - "using an Estimator, you'll need to return a tf.train.Saver " - "inside a tf.train.Scaffold from your model_fn.") % - (", ".join(sorted(missing_names)), ", ".join( - sorted(extra_names)), len(intersecting_names))) + "make this a dictionary with the old names as keys.") % + (", ".join(sorted(missing_names)), ", ".join( + sorted(extra_names)), len(intersecting_names))) for saveable in saveables: for spec in saveable.specs: spec.name = names_to_keys[spec.name] diff --git a/tensorflow/python/training/sync_replicas_optimizer.py b/tensorflow/python/training/sync_replicas_optimizer.py index 26c26dc1ff7..e9c77593160 100644 --- a/tensorflow/python/training/sync_replicas_optimizer.py +++ b/tensorflow/python/training/sync_replicas_optimizer.py @@ -132,13 +132,6 @@ class SyncReplicasOptimizer(optimizer.Optimizer): while not mon_sess.should_stop(): mon_sess.run(training_op) ``` - - To use SyncReplicasOptimizer with an `Estimator`, you need to send - sync_replicas_hook while calling the fit. - ```python - my_estimator = DNNClassifier(..., optimizer=opt) - my_estimator.fit(..., hooks=[sync_replicas_hook]) - ``` """ @deprecation.deprecated( diff --git a/tensorflow/python/training/sync_replicas_optimizer_test.py b/tensorflow/python/training/sync_replicas_optimizer_test.py index 06a58715e32..1d47c2772dd 100644 --- a/tensorflow/python/training/sync_replicas_optimizer_test.py +++ b/tensorflow/python/training/sync_replicas_optimizer_test.py @@ -271,7 +271,6 @@ class SyncReplicasOptimizerHookTest(test.TestCase): "train.SyncReplicasOptimizer and train.GradientDescentOptimizer " "are V1 only APIs.") def testCanCreatedBeforeMinimizeCalled(self): - """This behavior is required to be integrated with Estimators.""" opt = training.SyncReplicasOptimizer( opt=gradient_descent.GradientDescentOptimizer(1.0), replicas_to_aggregate=1, diff --git a/tensorflow/python/training/training_util.py b/tensorflow/python/training/training_util.py index 778ad9771f8..b8b3220a859 100644 --- a/tensorflow/python/training/training_util.py +++ b/tensorflow/python/training/training_util.py @@ -393,9 +393,7 @@ def _get_or_create_global_step_read(graph=None): # add 'zero' so that it will create a copy of variable as Tensor. with graph.as_default() as g, g.name_scope(None): with g.name_scope(global_step_tensor.op.name + '/'): - # must ensure that global_step is initialized before - # this run. This is needed for example Estimator makes all model_fn build - # under global_step_read_tensor dependency. + # must ensure that global_step is initialized before this run. if isinstance(global_step_tensor, variables.Variable): global_step_value = cond.cond( variable_v1.is_variable_initialized(global_step_tensor), diff --git a/tensorflow/python/util/BUILD b/tensorflow/python/util/BUILD index a8b4b39669b..0cf659efb72 100644 --- a/tensorflow/python/util/BUILD +++ b/tensorflow/python/util/BUILD @@ -355,7 +355,6 @@ pytype_strict_library( visibility = [ "//tensorflow:__pkg__", "//tensorflow:__subpackages__", - "//tensorflow_estimator:__subpackages__", "//third_party/py/tensorflow_core:__subpackages__", ], deps = [ @@ -927,19 +926,6 @@ py_strict_library( ], ) -py_strict_library( - name = "deprecation_wrapper", - srcs = ["deprecation_wrapper.py"], - visibility = util_subpackage_visibility, - deps = [ - ":module_wrapper", - # global_test_configuration is added here because all major tests depend on this - # library. It isn't possible to add these test dependencies via tensorflow.bzl's - # py_test because not all tensorflow tests use tensorflow.bzl's py_test. - "//tensorflow/python:global_test_configuration", - ], -) - py_strict_library( name = "module_wrapper", srcs = ["module_wrapper.py"], diff --git a/tensorflow/python/util/deprecation.py b/tensorflow/python/util/deprecation.py index 08c117bd78f..36a62bddedc 100644 --- a/tensorflow/python/util/deprecation.py +++ b/tensorflow/python/util/deprecation.py @@ -747,10 +747,6 @@ class HiddenTfApiAttribute(property): front of the name (e.g. ClassName._variables). This doesn't work when attributes or methods are inherited from a parent class. To hide inherited attributes, set their values to be `deprecation.hide_attribute_from_api`. - For example, this is used in V2 Estimator to hide the deprecated - export_savedmodel method: - class EstimatorV2(Estimator): - export_savedmodel = deprecation.hide_attribute_from_api('...') """ def __init__(self, deprecation_message): diff --git a/tensorflow/python/util/deprecation_wrapper.py b/tensorflow/python/util/deprecation_wrapper.py deleted file mode 100644 index 2829217bb59..00000000000 --- a/tensorflow/python/util/deprecation_wrapper.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2019 The TensorFlow Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""Compatibility wrapper for TensorFlow modules to support deprecation messages. - -Please use module_wrapper instead. -TODO(yifeif): remove once no longer referred by estimator -""" - -from tensorflow.python.util import module_wrapper - -# For backward compatibility for other pip packages that use this class. -DeprecationWrapper = module_wrapper.TFModuleWrapper diff --git a/tensorflow/python/util/function_utils_test.py b/tensorflow/python/util/function_utils_test.py index 38fc3dedfd6..a17e7f2648c 100644 --- a/tensorflow/python/util/function_utils_test.py +++ b/tensorflow/python/util/function_utils_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Tests for Estimator related util.""" +"""Tests for function args retrieval utils.""" import functools diff --git a/tensorflow/python/util/tf_export.py b/tensorflow/python/util/tf_export.py index ade7504ca75..1408eb264a4 100644 --- a/tensorflow/python/util/tf_export.py +++ b/tensorflow/python/util/tf_export.py @@ -45,13 +45,12 @@ from typing import Any, NamedTuple, Optional, Protocol, TypeVar from tensorflow.python.util import tf_decorator from tensorflow.python.util import tf_inspect -ESTIMATOR_API_NAME = 'estimator' KERAS_API_NAME = 'keras' TENSORFLOW_API_NAME = 'tensorflow' # List of subpackage names used by TensorFlow components. Have to check that # TensorFlow core repo does not export any symbols under these names. -SUBPACKAGE_NAMESPACES = [ESTIMATOR_API_NAME] +SUBPACKAGE_NAMESPACES = [] class _Attributes(NamedTuple): @@ -62,9 +61,6 @@ class _Attributes(NamedTuple): # Attribute values must be unique to each API. API_ATTRS = { TENSORFLOW_API_NAME: _Attributes('_tf_api_names', '_tf_api_constants'), - ESTIMATOR_API_NAME: _Attributes( - '_estimator_api_names', '_estimator_api_constants' - ), KERAS_API_NAME: _Attributes('_keras_api_names', '_keras_api_constants'), } @@ -72,9 +68,6 @@ API_ATTRS_V1 = { TENSORFLOW_API_NAME: _Attributes( '_tf_api_names_v1', '_tf_api_constants_v1' ), - ESTIMATOR_API_NAME: _Attributes( - '_estimator_api_names_v1', '_estimator_api_constants_v1' - ), KERAS_API_NAME: _Attributes( '_keras_api_names_v1', '_keras_api_constants_v1' ), @@ -113,7 +106,7 @@ def get_canonical_name_for_symbol( Args: symbol: API function or class. - api_name: API name (tensorflow or estimator). + api_name: API name. Currently, only `tensorflow`. add_prefix_to_v1_names: Specifies whether a name available only in V1 should be prefixed with compat.v1. @@ -177,20 +170,16 @@ def get_v1_names(symbol: Any) -> Sequence[str]: symbol: symbol to get API names for. Returns: - List of all API names for this symbol including TensorFlow and - Estimator names. + List of all API names for this symbol. """ names_v1 = [] tensorflow_api_attr_v1 = API_ATTRS_V1[TENSORFLOW_API_NAME].names - estimator_api_attr_v1 = API_ATTRS_V1[ESTIMATOR_API_NAME].names keras_api_attr_v1 = API_ATTRS_V1[KERAS_API_NAME].names if not hasattr(symbol, '__dict__'): return names_v1 if tensorflow_api_attr_v1 in symbol.__dict__: names_v1.extend(getattr(symbol, tensorflow_api_attr_v1)) - if estimator_api_attr_v1 in symbol.__dict__: - names_v1.extend(getattr(symbol, estimator_api_attr_v1)) if keras_api_attr_v1 in symbol.__dict__: names_v1.extend(getattr(symbol, keras_api_attr_v1)) return names_v1 @@ -203,20 +192,16 @@ def get_v2_names(symbol: Any) -> Sequence[str]: symbol: symbol to get API names for. Returns: - List of all API names for this symbol including TensorFlow and - Estimator names. + List of all API names for this symbol. """ names_v2 = [] tensorflow_api_attr = API_ATTRS[TENSORFLOW_API_NAME].names - estimator_api_attr = API_ATTRS[ESTIMATOR_API_NAME].names keras_api_attr = API_ATTRS[KERAS_API_NAME].names if not hasattr(symbol, '__dict__'): return names_v2 if tensorflow_api_attr in symbol.__dict__: names_v2.extend(getattr(symbol, tensorflow_api_attr)) - if estimator_api_attr in symbol.__dict__: - names_v2.extend(getattr(symbol, estimator_api_attr)) if keras_api_attr in symbol.__dict__: names_v2.extend(getattr(symbol, keras_api_attr)) return names_v2 @@ -229,17 +214,13 @@ def get_v1_constants(module: Any) -> Sequence[str]: module: TensorFlow module. Returns: - List of all API constants under the given module including TensorFlow and - Estimator constants. + List of all API constants under the given module. """ constants_v1 = [] tensorflow_constants_attr_v1 = API_ATTRS_V1[TENSORFLOW_API_NAME].constants - estimator_constants_attr_v1 = API_ATTRS_V1[ESTIMATOR_API_NAME].constants if hasattr(module, tensorflow_constants_attr_v1): constants_v1.extend(getattr(module, tensorflow_constants_attr_v1)) - if hasattr(module, estimator_constants_attr_v1): - constants_v1.extend(getattr(module, estimator_constants_attr_v1)) return constants_v1 @@ -250,17 +231,13 @@ def get_v2_constants(module: Any) -> Sequence[str]: module: TensorFlow module. Returns: - List of all API constants under the given module including TensorFlow and - Estimator constants. + List of all API constants under the given module. """ constants_v2 = [] tensorflow_constants_attr = API_ATTRS[TENSORFLOW_API_NAME].constants - estimator_constants_attr = API_ATTRS[ESTIMATOR_API_NAME].constants if hasattr(module, tensorflow_constants_attr): constants_v2.extend(getattr(module, tensorflow_constants_attr)) - if hasattr(module, estimator_constants_attr): - constants_v2.extend(getattr(module, estimator_constants_attr)) return constants_v2 @@ -285,8 +262,7 @@ class api_export(object): # pylint: disable=invalid-name Args: *args: API names in dot delimited format. - api_name: Name of the API you want to generate (e.g. `tensorflow` or - `estimator`). Default is `tensorflow`. + api_name: API you want to generate Currently, only `tensorflow`. v1: Names for the TensorFlow V1 API. If not set, we will use V2 API names both for TensorFlow V1 and V2 APIs. allow_multiple_exports: Deprecated. @@ -300,11 +276,11 @@ class api_export(object): # pylint: disable=invalid-name def _validate_symbol_names(self) -> None: """Validate you are exporting symbols under an allowed package. - We need to ensure things exported by tf_export, estimator_export, etc. + We need to ensure things exported by tf_export, etc. export symbols under disjoint top-level package names. For TensorFlow, we check that it does not export anything under subpackage - names used by components (estimator, keras, etc.). + names used by components (keras, etc.). For each component, we check that it exports everything under its own subpackage. @@ -323,9 +299,7 @@ class api_export(object): # pylint: disable=invalid-name else: if not all(n.startswith(self._api_name) for n in all_symbol_names): raise InvalidSymbolNameError( - 'Can only export symbols under package name of component. ' - 'e.g. tensorflow_estimator must export all symbols under ' - 'tf.estimator' + 'Can only export symbols under package name of component.' ) def __call__(self, func: T) -> T: diff --git a/tensorflow/python/util/tf_export_test.py b/tensorflow/python/util/tf_export_test.py index 1a00fdf2669..1a447559fe1 100644 --- a/tensorflow/python/util/tf_export_test.py +++ b/tensorflow/python/util/tf_export_test.py @@ -169,16 +169,6 @@ class ValidateExportTest(test.TestCase): self.assertEqual([(('NAME_C', 'NAME_D'), 'abc'), (('NAME_E', 'NAME_F'), 0.5)], module2._tf_api_constants) - def testRaisesExceptionIfInvalidSymbolName(self): - # TensorFlow code is not allowed to export symbols under package - # tf.estimator - with self.assertRaises(tf_export.InvalidSymbolNameError): - tf_export.tf_export('estimator.invalid') - - def testRaisesExceptionIfInvalidV1SymbolName(self): - with self.assertRaises(tf_export.InvalidSymbolNameError): - tf_export.tf_export('valid', v1=['estimator.invalid']) - def testMultipleDecorators(self): def get_wrapper(func): diff --git a/tensorflow/tools/api/golden/v1/tensorflow.data.experimental.-checkpoint-input-pipeline-hook.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.data.experimental.-checkpoint-input-pipeline-hook.pbtxt deleted file mode 100644 index dc306bc9ce6..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.data.experimental.-checkpoint-input-pipeline-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.data.experimental.CheckpointInputPipelineHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'estimator\', \'external_state_policy\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.data.experimental.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.data.experimental.pbtxt index 043de4bdbf1..8b397c36a66 100644 --- a/tensorflow/tools/api/golden/v1/tensorflow.data.experimental.pbtxt +++ b/tensorflow/tools/api/golden/v1/tensorflow.data.experimental.pbtxt @@ -16,10 +16,6 @@ tf_module { name: "AutotuneOptions" mtype: "" } - member { - name: "CheckpointInputPipelineHook" - mtype: "" - } member { name: "CsvDataset" mtype: "" diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-baseline-classifier.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-baseline-classifier.pbtxt deleted file mode 100644 index 63e86d91a22..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-baseline-classifier.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.BaselineClassifier" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'model_dir\', \'n_classes\', \'weight_column\', \'label_vocabulary\', \'optimizer\', \'config\', \'loss_reduction\'], varargs=None, keywords=None, defaults=[\'None\', \'2\', \'None\', \'None\', \'Ftrl\', \'None\', \'weighted_sum\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-baseline-estimator.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-baseline-estimator.pbtxt deleted file mode 100644 index 5cf47a16be0..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-baseline-estimator.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.BaselineEstimator" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'head\', \'model_dir\', \'optimizer\', \'config\'], varargs=None, keywords=None, defaults=[\'None\', \'Ftrl\', \'None\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-baseline-regressor.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-baseline-regressor.pbtxt deleted file mode 100644 index 392b10e94e7..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-baseline-regressor.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.BaselineRegressor" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'model_dir\', \'label_dimension\', \'weight_column\', \'optimizer\', \'config\', \'loss_reduction\'], varargs=None, keywords=None, defaults=[\'None\', \'1\', \'None\', \'Ftrl\', \'None\', \'weighted_sum\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-best-exporter.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-best-exporter.pbtxt deleted file mode 100644 index 68145735bd5..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-best-exporter.pbtxt +++ /dev/null @@ -1,18 +0,0 @@ -path: "tensorflow.estimator.BestExporter" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'name\', \'serving_input_receiver_fn\', \'event_file_pattern\', \'compare_fn\', \'assets_extra\', \'as_text\', \'exports_to_keep\'], varargs=None, keywords=None, defaults=[\'best_exporter\', \'None\', \'eval/*.tfevents.*\', \'\', \'None\', \'False\', \'5\'], " - } - member_method { - name: "export" - argspec: "args=[\'self\', \'estimator\', \'export_path\', \'checkpoint_path\', \'eval_result\', \'is_the_final_export\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-binary-class-head.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-binary-class-head.pbtxt deleted file mode 100644 index 3495ab3748c..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-binary-class-head.pbtxt +++ /dev/null @@ -1,42 +0,0 @@ -path: "tensorflow.estimator.BinaryClassHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'weight_column\', \'thresholds\', \'label_vocabulary\', \'loss_reduction\', \'loss_fn\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'sum_over_batch_size\', \'None\', \'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\', \'keys\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-checkpoint-saver-hook.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-checkpoint-saver-hook.pbtxt deleted file mode 100644 index 5c87f49e5a2..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-checkpoint-saver-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.CheckpointSaverHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'checkpoint_dir\', \'save_secs\', \'save_steps\', \'saver\', \'checkpoint_basename\', \'scaffold\', \'listeners\', \'save_graph_def\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'model.ckpt\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-checkpoint-saver-listener.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-checkpoint-saver-listener.pbtxt deleted file mode 100644 index 111b7583f2c..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-checkpoint-saver-listener.pbtxt +++ /dev/null @@ -1,24 +0,0 @@ -path: "tensorflow.estimator.CheckpointSaverListener" -tf_class { - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "after_save" - argspec: "args=[\'self\', \'session\', \'global_step_value\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_save" - argspec: "args=[\'self\', \'session\', \'global_step_value\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\', \'global_step_value\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-classifier.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-classifier.pbtxt deleted file mode 100644 index 0124eb4df88..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-classifier.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.DNNClassifier" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'hidden_units\', \'feature_columns\', \'model_dir\', \'n_classes\', \'weight_column\', \'label_vocabulary\', \'optimizer\', \'activation_fn\', \'dropout\', \'input_layer_partitioner\', \'config\', \'warm_start_from\', \'loss_reduction\', \'batch_norm\'], varargs=None, keywords=None, defaults=[\'None\', \'2\', \'None\', \'None\', \'Adagrad\', \'\', \'None\', \'None\', \'None\', \'None\', \'weighted_sum\', \'False\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-estimator.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-estimator.pbtxt deleted file mode 100644 index 14a38869f09..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-estimator.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.DNNEstimator" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'head\', \'hidden_units\', \'feature_columns\', \'model_dir\', \'optimizer\', \'activation_fn\', \'dropout\', \'input_layer_partitioner\', \'config\', \'warm_start_from\', \'batch_norm\'], varargs=None, keywords=None, defaults=[\'None\', \'Adagrad\', \'\', \'None\', \'None\', \'None\', \'None\', \'False\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-linear-combined-classifier.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-linear-combined-classifier.pbtxt deleted file mode 100644 index 0f8f5cd6f94..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-linear-combined-classifier.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.DNNLinearCombinedClassifier" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'model_dir\', \'linear_feature_columns\', \'linear_optimizer\', \'dnn_feature_columns\', \'dnn_optimizer\', \'dnn_hidden_units\', \'dnn_activation_fn\', \'dnn_dropout\', \'n_classes\', \'weight_column\', \'label_vocabulary\', \'input_layer_partitioner\', \'config\', \'warm_start_from\', \'loss_reduction\', \'batch_norm\', \'linear_sparse_combiner\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'Ftrl\', \'None\', \'Adagrad\', \'None\', \'\', \'None\', \'2\', \'None\', \'None\', \'None\', \'None\', \'None\', \'weighted_sum\', \'False\', \'sum\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-linear-combined-estimator.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-linear-combined-estimator.pbtxt deleted file mode 100644 index 3a3d44c0c18..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-linear-combined-estimator.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.DNNLinearCombinedEstimator" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'head\', \'model_dir\', \'linear_feature_columns\', \'linear_optimizer\', \'dnn_feature_columns\', \'dnn_optimizer\', \'dnn_hidden_units\', \'dnn_activation_fn\', \'dnn_dropout\', \'input_layer_partitioner\', \'config\', \'batch_norm\', \'linear_sparse_combiner\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'Ftrl\', \'None\', \'Adagrad\', \'None\', \'\', \'None\', \'None\', \'None\', \'False\', \'sum\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-linear-combined-regressor.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-linear-combined-regressor.pbtxt deleted file mode 100644 index 0915b116dc6..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-linear-combined-regressor.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.DNNLinearCombinedRegressor" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'model_dir\', \'linear_feature_columns\', \'linear_optimizer\', \'dnn_feature_columns\', \'dnn_optimizer\', \'dnn_hidden_units\', \'dnn_activation_fn\', \'dnn_dropout\', \'label_dimension\', \'weight_column\', \'input_layer_partitioner\', \'config\', \'warm_start_from\', \'loss_reduction\', \'batch_norm\', \'linear_sparse_combiner\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'Ftrl\', \'None\', \'Adagrad\', \'None\', \'\', \'None\', \'1\', \'None\', \'None\', \'None\', \'None\', \'weighted_sum\', \'False\', \'sum\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-regressor.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-regressor.pbtxt deleted file mode 100644 index 9b99bbed340..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-d-n-n-regressor.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.DNNRegressor" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'hidden_units\', \'feature_columns\', \'model_dir\', \'label_dimension\', \'weight_column\', \'optimizer\', \'activation_fn\', \'dropout\', \'input_layer_partitioner\', \'config\', \'warm_start_from\', \'loss_reduction\', \'batch_norm\'], varargs=None, keywords=None, defaults=[\'None\', \'1\', \'None\', \'Adagrad\', \'\', \'None\', \'None\', \'None\', \'None\', \'weighted_sum\', \'False\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-estimator-spec.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-estimator-spec.pbtxt deleted file mode 100644 index 376becc3f9b..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-estimator-spec.pbtxt +++ /dev/null @@ -1,59 +0,0 @@ -path: "tensorflow.estimator.EstimatorSpec" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "eval_metric_ops" - mtype: "" - } - member { - name: "evaluation_hooks" - mtype: "" - } - member { - name: "export_outputs" - mtype: "" - } - member { - name: "loss" - mtype: "" - } - member { - name: "mode" - mtype: "" - } - member { - name: "prediction_hooks" - mtype: "" - } - member { - name: "predictions" - mtype: "" - } - member { - name: "scaffold" - mtype: "" - } - member { - name: "train_op" - mtype: "" - } - member { - name: "training_chief_hooks" - mtype: "" - } - member { - name: "training_hooks" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-estimator.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-estimator.pbtxt deleted file mode 100644 index 78058dccd10..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-estimator.pbtxt +++ /dev/null @@ -1,65 +0,0 @@ -path: "tensorflow.estimator.Estimator" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'model_fn\', \'model_dir\', \'config\', \'params\', \'warm_start_from\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-eval-spec.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-eval-spec.pbtxt deleted file mode 100644 index 23c2544fe46..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-eval-spec.pbtxt +++ /dev/null @@ -1,43 +0,0 @@ -path: "tensorflow.estimator.EvalSpec" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "exporters" - mtype: "" - } - member { - name: "hooks" - mtype: "" - } - member { - name: "input_fn" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member { - name: "start_delay_secs" - mtype: "" - } - member { - name: "steps" - mtype: "" - } - member { - name: "throttle_secs" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-exporter.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-exporter.pbtxt deleted file mode 100644 index 6c3f0fd9108..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-exporter.pbtxt +++ /dev/null @@ -1,16 +0,0 @@ -path: "tensorflow.estimator.Exporter" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "export" - argspec: "args=[\'self\', \'estimator\', \'export_path\', \'checkpoint_path\', \'eval_result\', \'is_the_final_export\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-feed-fn-hook.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-feed-fn-hook.pbtxt deleted file mode 100644 index f24de493f24..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-feed-fn-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.FeedFnHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'feed_fn\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-final-exporter.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-final-exporter.pbtxt deleted file mode 100644 index e030d401ea4..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-final-exporter.pbtxt +++ /dev/null @@ -1,18 +0,0 @@ -path: "tensorflow.estimator.FinalExporter" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'name\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\'], varargs=None, keywords=None, defaults=[\'None\', \'False\'], " - } - member_method { - name: "export" - argspec: "args=[\'self\', \'estimator\', \'export_path\', \'checkpoint_path\', \'eval_result\', \'is_the_final_export\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-final-ops-hook.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-final-ops-hook.pbtxt deleted file mode 100644 index 6651170ba33..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-final-ops-hook.pbtxt +++ /dev/null @@ -1,34 +0,0 @@ -path: "tensorflow.estimator.FinalOpsHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "final_ops_values" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'final_ops\', \'final_ops_feed_dict\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-global-step-waiter-hook.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-global-step-waiter-hook.pbtxt deleted file mode 100644 index 37db48bc64e..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-global-step-waiter-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.GlobalStepWaiterHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'wait_until_step\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-head.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-head.pbtxt deleted file mode 100644 index 81dab147236..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-head.pbtxt +++ /dev/null @@ -1,40 +0,0 @@ -path: "tensorflow.estimator.Head" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\', \'keys\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-latest-exporter.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-latest-exporter.pbtxt deleted file mode 100644 index d67f2bd625e..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-latest-exporter.pbtxt +++ /dev/null @@ -1,18 +0,0 @@ -path: "tensorflow.estimator.LatestExporter" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'name\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'exports_to_keep\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'5\'], " - } - member_method { - name: "export" - argspec: "args=[\'self\', \'estimator\', \'export_path\', \'checkpoint_path\', \'eval_result\', \'is_the_final_export\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-linear-classifier.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-linear-classifier.pbtxt deleted file mode 100644 index 5862a8a5123..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-linear-classifier.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.LinearClassifier" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'feature_columns\', \'model_dir\', \'n_classes\', \'weight_column\', \'label_vocabulary\', \'optimizer\', \'config\', \'partitioner\', \'warm_start_from\', \'loss_reduction\', \'sparse_combiner\'], varargs=None, keywords=None, defaults=[\'None\', \'2\', \'None\', \'None\', \'Ftrl\', \'None\', \'None\', \'None\', \'weighted_sum\', \'sum\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-linear-estimator.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-linear-estimator.pbtxt deleted file mode 100644 index c0d1c52631a..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-linear-estimator.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.LinearEstimator" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'head\', \'feature_columns\', \'model_dir\', \'optimizer\', \'config\', \'partitioner\', \'sparse_combiner\', \'warm_start_from\'], varargs=None, keywords=None, defaults=[\'None\', \'Ftrl\', \'None\', \'None\', \'sum\', \'None\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-linear-regressor.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-linear-regressor.pbtxt deleted file mode 100644 index 62fe43d249b..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-linear-regressor.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.LinearRegressor" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'feature_columns\', \'model_dir\', \'label_dimension\', \'weight_column\', \'optimizer\', \'config\', \'partitioner\', \'warm_start_from\', \'loss_reduction\', \'sparse_combiner\'], varargs=None, keywords=None, defaults=[\'None\', \'1\', \'None\', \'Ftrl\', \'None\', \'None\', \'None\', \'weighted_sum\', \'sum\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-logging-tensor-hook.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-logging-tensor-hook.pbtxt deleted file mode 100644 index 425f0167a16..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-logging-tensor-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.LoggingTensorHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'tensors\', \'every_n_iter\', \'every_n_secs\', \'at_end\', \'formatter\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'False\', \'None\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-logistic-regression-head.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-logistic-regression-head.pbtxt deleted file mode 100644 index 7399099f160..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-logistic-regression-head.pbtxt +++ /dev/null @@ -1,43 +0,0 @@ -path: "tensorflow.estimator.LogisticRegressionHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'weight_column\', \'loss_reduction\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'sum_over_batch_size\', \'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-mode-keys.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-mode-keys.pbtxt deleted file mode 100644 index d5375278009..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-mode-keys.pbtxt +++ /dev/null @@ -1,20 +0,0 @@ -path: "tensorflow.estimator.ModeKeys" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "EVAL" - mtype: "" - } - member { - name: "PREDICT" - mtype: "" - } - member { - name: "TRAIN" - mtype: "" - } - member_method { - name: "__init__" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-multi-class-head.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-multi-class-head.pbtxt deleted file mode 100644 index 4629e78c5bf..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-multi-class-head.pbtxt +++ /dev/null @@ -1,42 +0,0 @@ -path: "tensorflow.estimator.MultiClassHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'n_classes\', \'weight_column\', \'label_vocabulary\', \'loss_reduction\', \'loss_fn\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'sum_over_batch_size\', \'None\', \'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\', \'keys\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-multi-head.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-multi-head.pbtxt deleted file mode 100644 index 715471f536e..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-multi-head.pbtxt +++ /dev/null @@ -1,42 +0,0 @@ -path: "tensorflow.estimator.MultiHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'heads\', \'head_weights\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\', \'keys\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-multi-label-head.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-multi-label-head.pbtxt deleted file mode 100644 index 00bff2f14ed..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-multi-label-head.pbtxt +++ /dev/null @@ -1,42 +0,0 @@ -path: "tensorflow.estimator.MultiLabelHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'n_classes\', \'weight_column\', \'thresholds\', \'label_vocabulary\', \'loss_reduction\', \'loss_fn\', \'classes_for_class_based_metrics\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'sum_over_batch_size\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\', \'keys\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-nan-loss-during-training-error.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-nan-loss-during-training-error.pbtxt deleted file mode 100644 index fc37f269220..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-nan-loss-during-training-error.pbtxt +++ /dev/null @@ -1,15 +0,0 @@ -path: "tensorflow.estimator.NanLossDuringTrainingError" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "args" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "add_note" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-nan-tensor-hook.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-nan-tensor-hook.pbtxt deleted file mode 100644 index 82293c2c0c4..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-nan-tensor-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.NanTensorHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'loss_tensor\', \'fail_on_nan_loss\'], varargs=None, keywords=None, defaults=[\'True\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-poisson-regression-head.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-poisson-regression-head.pbtxt deleted file mode 100644 index 834afda2ce6..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-poisson-regression-head.pbtxt +++ /dev/null @@ -1,43 +0,0 @@ -path: "tensorflow.estimator.PoissonRegressionHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'label_dimension\', \'weight_column\', \'loss_reduction\', \'compute_full_loss\', \'name\'], varargs=None, keywords=None, defaults=[\'1\', \'None\', \'sum_over_batch_size\', \'True\', \'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-profiler-hook.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-profiler-hook.pbtxt deleted file mode 100644 index 65b5fb16b08..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-profiler-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.ProfilerHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'save_steps\', \'save_secs\', \'output_dir\', \'show_dataflow\', \'show_memory\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'\', \'True\', \'False\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-regression-head.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-regression-head.pbtxt deleted file mode 100644 index 67960eb0339..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-regression-head.pbtxt +++ /dev/null @@ -1,42 +0,0 @@ -path: "tensorflow.estimator.RegressionHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'label_dimension\', \'weight_column\', \'loss_reduction\', \'loss_fn\', \'inverse_link_fn\', \'name\'], varargs=None, keywords=None, defaults=[\'1\', \'None\', \'sum_over_batch_size\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-run-config.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-run-config.pbtxt deleted file mode 100644 index e124a23e9a3..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-run-config.pbtxt +++ /dev/null @@ -1,117 +0,0 @@ -path: "tensorflow.estimator.RunConfig" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "checkpoint_save_graph_def" - mtype: "" - } - member { - name: "cluster_spec" - mtype: "" - } - member { - name: "device_fn" - mtype: "" - } - member { - name: "eval_distribute" - mtype: "" - } - member { - name: "evaluation_master" - mtype: "" - } - member { - name: "experimental_max_worker_delay_secs" - mtype: "" - } - member { - name: "global_id_in_cluster" - mtype: "" - } - member { - name: "is_chief" - mtype: "" - } - member { - name: "keep_checkpoint_every_n_hours" - mtype: "" - } - member { - name: "keep_checkpoint_max" - mtype: "" - } - member { - name: "log_step_count_steps" - mtype: "" - } - member { - name: "master" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "num_ps_replicas" - mtype: "" - } - member { - name: "num_worker_replicas" - mtype: "" - } - member { - name: "protocol" - mtype: "" - } - member { - name: "save_checkpoints_secs" - mtype: "" - } - member { - name: "save_checkpoints_steps" - mtype: "" - } - member { - name: "save_summary_steps" - mtype: "" - } - member { - name: "service" - mtype: "" - } - member { - name: "session_config" - mtype: "" - } - member { - name: "session_creation_timeout_secs" - mtype: "" - } - member { - name: "task_id" - mtype: "" - } - member { - name: "task_type" - mtype: "" - } - member { - name: "tf_random_seed" - mtype: "" - } - member { - name: "train_distribute" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'model_dir\', \'tf_random_seed\', \'save_summary_steps\', \'save_checkpoints_steps\', \'save_checkpoints_secs\', \'session_config\', \'keep_checkpoint_max\', \'keep_checkpoint_every_n_hours\', \'log_step_count_steps\', \'train_distribute\', \'device_fn\', \'protocol\', \'eval_distribute\', \'experimental_distribute\', \'experimental_max_worker_delay_secs\', \'session_creation_timeout_secs\', \'checkpoint_save_graph_def\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'100\', \'\', \'\', \'None\', \'5\', \'10000\', \'100\', \'None\', \'None\', \'None\', \'None\', \'None\', \'None\', \'7200\', \'True\'], " - } - member_method { - name: "replace" - argspec: "args=[\'self\'], varargs=None, keywords=kwargs, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-second-or-step-timer.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-second-or-step-timer.pbtxt deleted file mode 100644 index 64051d2bd6b..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-second-or-step-timer.pbtxt +++ /dev/null @@ -1,26 +0,0 @@ -path: "tensorflow.estimator.SecondOrStepTimer" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'every_secs\', \'every_steps\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], " - } - member_method { - name: "last_triggered_step" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "reset" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "should_trigger_for_step" - argspec: "args=[\'self\', \'step\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "update_last_triggered_step" - argspec: "args=[\'self\', \'step\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-args.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-args.pbtxt deleted file mode 100644 index b375c742946..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-args.pbtxt +++ /dev/null @@ -1,27 +0,0 @@ -path: "tensorflow.estimator.SessionRunArgs" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "feed_dict" - mtype: "" - } - member { - name: "fetches" - mtype: "" - } - member { - name: "options" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-context.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-context.pbtxt deleted file mode 100644 index cb4ac9f50ec..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-context.pbtxt +++ /dev/null @@ -1,25 +0,0 @@ -path: "tensorflow.estimator.SessionRunContext" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "original_args" - mtype: "" - } - member { - name: "session" - mtype: "" - } - member { - name: "stop_requested" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'original_args\', \'session\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "request_stop" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-hook.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-hook.pbtxt deleted file mode 100644 index 54e9ad9ed44..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-hook.pbtxt +++ /dev/null @@ -1,28 +0,0 @@ -path: "tensorflow.estimator.SessionRunHook" -tf_class { - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-values.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-values.pbtxt deleted file mode 100644 index 67881416963..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-session-run-values.pbtxt +++ /dev/null @@ -1,27 +0,0 @@ -path: "tensorflow.estimator.SessionRunValues" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "options" - mtype: "" - } - member { - name: "results" - mtype: "" - } - member { - name: "run_metadata" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-step-counter-hook.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-step-counter-hook.pbtxt deleted file mode 100644 index 4368e04df3f..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-step-counter-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.StepCounterHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'every_n_steps\', \'every_n_secs\', \'output_dir\', \'summary_writer\'], varargs=None, keywords=None, defaults=[\'100\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-stop-at-step-hook.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-stop-at-step-hook.pbtxt deleted file mode 100644 index 938b189a8c3..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-stop-at-step-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.StopAtStepHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'num_steps\', \'last_step\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-summary-saver-hook.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-summary-saver-hook.pbtxt deleted file mode 100644 index 104157315f5..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-summary-saver-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.SummarySaverHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'save_steps\', \'save_secs\', \'output_dir\', \'summary_writer\', \'scaffold\', \'summary_op\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-train-spec.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-train-spec.pbtxt deleted file mode 100644 index 9939469b562..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-train-spec.pbtxt +++ /dev/null @@ -1,31 +0,0 @@ -path: "tensorflow.estimator.TrainSpec" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "hooks" - mtype: "" - } - member { - name: "input_fn" - mtype: "" - } - member { - name: "max_steps" - mtype: "" - } - member { - name: "saving_listeners" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-vocab-info.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-vocab-info.pbtxt deleted file mode 100644 index b6942cb7ed8..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-vocab-info.pbtxt +++ /dev/null @@ -1,43 +0,0 @@ -path: "tensorflow.estimator.VocabInfo" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "axis" - mtype: "" - } - member { - name: "backup_initializer" - mtype: "" - } - member { - name: "new_vocab" - mtype: "" - } - member { - name: "new_vocab_size" - mtype: "" - } - member { - name: "num_oov_buckets" - mtype: "" - } - member { - name: "old_vocab" - mtype: "" - } - member { - name: "old_vocab_size" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-warm-start-settings.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.-warm-start-settings.pbtxt deleted file mode 100644 index dca2c1fe117..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.-warm-start-settings.pbtxt +++ /dev/null @@ -1,31 +0,0 @@ -path: "tensorflow.estimator.WarmStartSettings" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "ckpt_to_initialize_from" - mtype: "" - } - member { - name: "var_name_to_prev_var_name" - mtype: "" - } - member { - name: "var_name_to_vocab_info" - mtype: "" - } - member { - name: "vars_to_warm_start" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.-in-memory-evaluator-hook.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.-in-memory-evaluator-hook.pbtxt deleted file mode 100644 index 5a2a01cd532..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.-in-memory-evaluator-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.experimental.InMemoryEvaluatorHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'estimator\', \'input_fn\', \'steps\', \'hooks\', \'name\', \'every_n_iter\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'100\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.-k-means.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.-k-means.pbtxt deleted file mode 100644 index 670aa40b0c8..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.-k-means.pbtxt +++ /dev/null @@ -1,114 +0,0 @@ -path: "tensorflow.estimator.experimental.KMeans" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "ALL_DISTANCES" - mtype: "" - } - member { - name: "CLUSTER_CENTERS_VAR_NAME" - mtype: "" - } - member { - name: "CLUSTER_INDEX" - mtype: "" - } - member { - name: "COSINE_DISTANCE" - mtype: "" - } - member { - name: "KMEANS_PLUS_PLUS_INIT" - mtype: "" - } - member { - name: "RANDOM_INIT" - mtype: "" - } - member { - name: "SCORE" - mtype: "" - } - member { - name: "SQUARED_EUCLIDEAN_DISTANCE" - mtype: "" - } - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'num_clusters\', \'model_dir\', \'initial_clusters\', \'distance_metric\', \'seed\', \'use_mini_batch\', \'mini_batch_steps_per_iteration\', \'kmeans_plus_plus_num_retries\', \'relative_tolerance\', \'config\', \'feature_columns\'], varargs=None, keywords=None, defaults=[\'None\', \'random\', \'squared_euclidean\', \'None\', \'True\', \'1\', \'2\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "cluster_centers" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "predict_cluster_index" - argspec: "args=[\'self\', \'input_fn\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "score" - argspec: "args=[\'self\', \'input_fn\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "transform" - argspec: "args=[\'self\', \'input_fn\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.-linear-s-d-c-a.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.-linear-s-d-c-a.pbtxt deleted file mode 100644 index 85292e4d7ed..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.-linear-s-d-c-a.pbtxt +++ /dev/null @@ -1,13 +0,0 @@ -path: "tensorflow.estimator.experimental.LinearSDCA" -tf_class { - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'example_id_column\', \'num_loss_partitions\', \'num_table_shards\', \'symmetric_l1_regularization\', \'symmetric_l2_regularization\', \'adaptive\'], varargs=None, keywords=None, defaults=[\'1\', \'None\', \'0.0\', \'1.0\', \'False\'], " - } - member_method { - name: "get_train_step" - argspec: "args=[\'self\', \'state_manager\', \'weight_column_name\', \'loss_type\', \'feature_columns\', \'features\', \'targets\', \'bias_var\', \'global_step\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.pbtxt deleted file mode 100644 index b247485d891..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.experimental.pbtxt +++ /dev/null @@ -1,55 +0,0 @@ -path: "tensorflow.estimator.experimental" -tf_module { - member { - name: "InMemoryEvaluatorHook" - mtype: "" - } - member { - name: "KMeans" - mtype: "" - } - member { - name: "LinearSDCA" - mtype: "" - } - member_method { - name: "build_raw_supervised_input_receiver_fn" - argspec: "args=[\'features\', \'labels\', \'default_batch_size\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "call_logit_fn" - argspec: "args=[\'logit_fn\', \'features\', \'mode\', \'params\', \'config\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "dnn_logit_fn_builder" - argspec: "args=[\'units\', \'hidden_units\', \'feature_columns\', \'activation_fn\', \'dropout\', \'input_layer_partitioner\', \'batch_norm\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "linear_logit_fn_builder" - argspec: "args=[\'units\', \'feature_columns\', \'sparse_combiner\'], varargs=None, keywords=None, defaults=[\'sum\'], " - } - member_method { - name: "make_early_stopping_hook" - argspec: "args=[\'estimator\', \'should_stop_fn\', \'run_every_secs\', \'run_every_steps\'], varargs=None, keywords=None, defaults=[\'60\', \'None\'], " - } - member_method { - name: "make_stop_at_checkpoint_step_hook" - argspec: "args=[\'estimator\', \'last_step\', \'wait_after_file_check_secs\'], varargs=None, keywords=None, defaults=[\'30\'], " - } - member_method { - name: "stop_if_higher_hook" - argspec: "args=[\'estimator\', \'metric_name\', \'threshold\', \'eval_dir\', \'min_steps\', \'run_every_secs\', \'run_every_steps\'], varargs=None, keywords=None, defaults=[\'None\', \'0\', \'60\', \'None\'], " - } - member_method { - name: "stop_if_lower_hook" - argspec: "args=[\'estimator\', \'metric_name\', \'threshold\', \'eval_dir\', \'min_steps\', \'run_every_secs\', \'run_every_steps\'], varargs=None, keywords=None, defaults=[\'None\', \'0\', \'60\', \'None\'], " - } - member_method { - name: "stop_if_no_decrease_hook" - argspec: "args=[\'estimator\', \'metric_name\', \'max_steps_without_decrease\', \'eval_dir\', \'min_steps\', \'run_every_secs\', \'run_every_steps\'], varargs=None, keywords=None, defaults=[\'None\', \'0\', \'60\', \'None\'], " - } - member_method { - name: "stop_if_no_increase_hook" - argspec: "args=[\'estimator\', \'metric_name\', \'max_steps_without_increase\', \'eval_dir\', \'min_steps\', \'run_every_secs\', \'run_every_steps\'], varargs=None, keywords=None, defaults=[\'None\', \'0\', \'60\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-classification-output.__metaclass__.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-classification-output.__metaclass__.pbtxt deleted file mode 100644 index 820afac8e10..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-classification-output.__metaclass__.pbtxt +++ /dev/null @@ -1,14 +0,0 @@ -path: "tensorflow.estimator.export.ClassificationOutput.__metaclass__" -tf_class { - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "mro" - } - member_method { - name: "register" - argspec: "args=[\'cls\', \'subclass\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-classification-output.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-classification-output.pbtxt deleted file mode 100644 index ce486807a47..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-classification-output.pbtxt +++ /dev/null @@ -1,22 +0,0 @@ -path: "tensorflow.estimator.export.ClassificationOutput" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "classes" - mtype: "" - } - member { - name: "scores" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'scores\', \'classes\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], " - } - member_method { - name: "as_signature_def" - argspec: "args=[\'self\', \'receiver_tensors\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-eval-output.__metaclass__.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-eval-output.__metaclass__.pbtxt deleted file mode 100644 index ce7b697d102..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-eval-output.__metaclass__.pbtxt +++ /dev/null @@ -1,14 +0,0 @@ -path: "tensorflow.estimator.export.EvalOutput.__metaclass__" -tf_class { - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "mro" - } - member_method { - name: "register" - argspec: "args=[\'cls\', \'subclass\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-eval-output.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-eval-output.pbtxt deleted file mode 100644 index 0da3f73851d..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-eval-output.pbtxt +++ /dev/null @@ -1,47 +0,0 @@ -path: "tensorflow.estimator.export.EvalOutput" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "LOSS_NAME" - mtype: "" - } - member { - name: "METRICS_NAME" - mtype: "" - } - member { - name: "METRIC_UPDATE_SUFFIX" - mtype: "" - } - member { - name: "METRIC_VALUE_SUFFIX" - mtype: "" - } - member { - name: "PREDICTIONS_NAME" - mtype: "" - } - member { - name: "loss" - mtype: "" - } - member { - name: "metrics" - mtype: "" - } - member { - name: "predictions" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'loss\', \'predictions\', \'metrics\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "as_signature_def" - argspec: "args=[\'self\', \'receiver_tensors\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-export-output.__metaclass__.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-export-output.__metaclass__.pbtxt deleted file mode 100644 index b811e1f3dab..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-export-output.__metaclass__.pbtxt +++ /dev/null @@ -1,14 +0,0 @@ -path: "tensorflow.estimator.export.ExportOutput.__metaclass__" -tf_class { - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "mro" - } - member_method { - name: "register" - argspec: "args=[\'cls\', \'subclass\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-export-output.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-export-output.pbtxt deleted file mode 100644 index 9775b2cca81..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-export-output.pbtxt +++ /dev/null @@ -1,12 +0,0 @@ -path: "tensorflow.estimator.export.ExportOutput" -tf_class { - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "as_signature_def" - argspec: "args=[\'self\', \'receiver_tensors\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-predict-output.__metaclass__.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-predict-output.__metaclass__.pbtxt deleted file mode 100644 index bdfcb9c8882..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-predict-output.__metaclass__.pbtxt +++ /dev/null @@ -1,14 +0,0 @@ -path: "tensorflow.estimator.export.PredictOutput.__metaclass__" -tf_class { - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "mro" - } - member_method { - name: "register" - argspec: "args=[\'cls\', \'subclass\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-predict-output.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-predict-output.pbtxt deleted file mode 100644 index a4389fb998e..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-predict-output.pbtxt +++ /dev/null @@ -1,18 +0,0 @@ -path: "tensorflow.estimator.export.PredictOutput" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "outputs" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'outputs\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "as_signature_def" - argspec: "args=[\'self\', \'receiver_tensors\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-regression-output.__metaclass__.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-regression-output.__metaclass__.pbtxt deleted file mode 100644 index dcd7cbf427e..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-regression-output.__metaclass__.pbtxt +++ /dev/null @@ -1,14 +0,0 @@ -path: "tensorflow.estimator.export.RegressionOutput.__metaclass__" -tf_class { - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "mro" - } - member_method { - name: "register" - argspec: "args=[\'cls\', \'subclass\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-regression-output.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-regression-output.pbtxt deleted file mode 100644 index fc7f8447893..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-regression-output.pbtxt +++ /dev/null @@ -1,18 +0,0 @@ -path: "tensorflow.estimator.export.RegressionOutput" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "value" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'value\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "as_signature_def" - argspec: "args=[\'self\', \'receiver_tensors\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-serving-input-receiver.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-serving-input-receiver.pbtxt deleted file mode 100644 index a0371a16635..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-serving-input-receiver.pbtxt +++ /dev/null @@ -1,27 +0,0 @@ -path: "tensorflow.estimator.export.ServingInputReceiver" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "features" - mtype: "" - } - member { - name: "receiver_tensors" - mtype: "" - } - member { - name: "receiver_tensors_alternatives" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-tensor-serving-input-receiver.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-tensor-serving-input-receiver.pbtxt deleted file mode 100644 index da9d05df237..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.-tensor-serving-input-receiver.pbtxt +++ /dev/null @@ -1,27 +0,0 @@ -path: "tensorflow.estimator.export.TensorServingInputReceiver" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "features" - mtype: "" - } - member { - name: "receiver_tensors" - mtype: "" - } - member { - name: "receiver_tensors_alternatives" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.pbtxt deleted file mode 100644 index 3fe3d5963c6..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.export.pbtxt +++ /dev/null @@ -1,39 +0,0 @@ -path: "tensorflow.estimator.export" -tf_module { - member { - name: "ClassificationOutput" - mtype: "" - } - member { - name: "EvalOutput" - mtype: "" - } - member { - name: "ExportOutput" - mtype: "" - } - member { - name: "PredictOutput" - mtype: "" - } - member { - name: "RegressionOutput" - mtype: "" - } - member { - name: "ServingInputReceiver" - mtype: "" - } - member { - name: "TensorServingInputReceiver" - mtype: "" - } - member_method { - name: "build_parsing_serving_input_receiver_fn" - argspec: "args=[\'feature_spec\', \'default_batch_size\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "build_raw_serving_input_receiver_fn" - argspec: "args=[\'features\', \'default_batch_size\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.inputs.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.inputs.pbtxt deleted file mode 100644 index b318fea1f82..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.inputs.pbtxt +++ /dev/null @@ -1,11 +0,0 @@ -path: "tensorflow.estimator.inputs" -tf_module { - member_method { - name: "numpy_input_fn" - argspec: "args=[\'x\', \'y\', \'batch_size\', \'num_epochs\', \'shuffle\', \'queue_capacity\', \'num_threads\'], varargs=None, keywords=None, defaults=[\'None\', \'128\', \'1\', \'None\', \'1000\', \'1\'], " - } - member_method { - name: "pandas_input_fn" - argspec: "args=[\'x\', \'y\', \'batch_size\', \'num_epochs\', \'shuffle\', \'queue_capacity\', \'num_threads\', \'target_column\'], varargs=None, keywords=None, defaults=[\'None\', \'128\', \'1\', \'None\', \'1000\', \'1\', \'target\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.pbtxt deleted file mode 100644 index 72153f2b2fe..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.pbtxt +++ /dev/null @@ -1,231 +0,0 @@ -path: "tensorflow.estimator" -tf_module { - member { - name: "BaselineClassifier" - mtype: "" - } - member { - name: "BaselineEstimator" - mtype: "" - } - member { - name: "BaselineRegressor" - mtype: "" - } - member { - name: "BestExporter" - mtype: "" - } - member { - name: "BinaryClassHead" - mtype: "" - } - member { - name: "CheckpointSaverHook" - mtype: "" - } - member { - name: "CheckpointSaverListener" - mtype: "" - } - member { - name: "DNNClassifier" - mtype: "" - } - member { - name: "DNNEstimator" - mtype: "" - } - member { - name: "DNNLinearCombinedClassifier" - mtype: "" - } - member { - name: "DNNLinearCombinedEstimator" - mtype: "" - } - member { - name: "DNNLinearCombinedRegressor" - mtype: "" - } - member { - name: "DNNRegressor" - mtype: "" - } - member { - name: "Estimator" - mtype: "" - } - member { - name: "EstimatorSpec" - mtype: "" - } - member { - name: "EvalSpec" - mtype: "" - } - member { - name: "Exporter" - mtype: "" - } - member { - name: "FeedFnHook" - mtype: "" - } - member { - name: "FinalExporter" - mtype: "" - } - member { - name: "FinalOpsHook" - mtype: "" - } - member { - name: "GlobalStepWaiterHook" - mtype: "" - } - member { - name: "Head" - mtype: "" - } - member { - name: "LatestExporter" - mtype: "" - } - member { - name: "LinearClassifier" - mtype: "" - } - member { - name: "LinearEstimator" - mtype: "" - } - member { - name: "LinearRegressor" - mtype: "" - } - member { - name: "LoggingTensorHook" - mtype: "" - } - member { - name: "LogisticRegressionHead" - mtype: "" - } - member { - name: "ModeKeys" - mtype: "" - } - member { - name: "MultiClassHead" - mtype: "" - } - member { - name: "MultiHead" - mtype: "" - } - member { - name: "MultiLabelHead" - mtype: "" - } - member { - name: "NanLossDuringTrainingError" - mtype: "" - } - member { - name: "NanTensorHook" - mtype: "" - } - member { - name: "PoissonRegressionHead" - mtype: "" - } - member { - name: "ProfilerHook" - mtype: "" - } - member { - name: "RegressionHead" - mtype: "" - } - member { - name: "RunConfig" - mtype: "" - } - member { - name: "SecondOrStepTimer" - mtype: "" - } - member { - name: "SessionRunArgs" - mtype: "" - } - member { - name: "SessionRunContext" - mtype: "" - } - member { - name: "SessionRunHook" - mtype: "" - } - member { - name: "SessionRunValues" - mtype: "" - } - member { - name: "StepCounterHook" - mtype: "" - } - member { - name: "StopAtStepHook" - mtype: "" - } - member { - name: "SummarySaverHook" - mtype: "" - } - member { - name: "TrainSpec" - mtype: "" - } - member { - name: "VocabInfo" - mtype: "" - } - member { - name: "WarmStartSettings" - mtype: "" - } - member { - name: "experimental" - mtype: "" - } - member { - name: "export" - mtype: "" - } - member { - name: "inputs" - mtype: "" - } - member { - name: "tpu" - mtype: "" - } - member_method { - name: "add_metrics" - argspec: "args=[\'estimator\', \'metric_fn\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "classifier_parse_example_spec" - argspec: "args=[\'feature_columns\', \'label_key\', \'label_dtype\', \'label_default\', \'weight_column\'], varargs=None, keywords=None, defaults=[\"\", \'None\', \'None\'], " - } - member_method { - name: "regressor_parse_example_spec" - argspec: "args=[\'feature_columns\', \'label_key\', \'label_dtype\', \'label_default\', \'label_dimension\', \'weight_column\'], varargs=None, keywords=None, defaults=[\"\", \'None\', \'1\', \'None\'], " - } - member_method { - name: "train_and_evaluate" - argspec: "args=[\'estimator\', \'train_spec\', \'eval_spec\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-input-pipeline-config.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-input-pipeline-config.pbtxt deleted file mode 100644 index 83558e007b4..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-input-pipeline-config.pbtxt +++ /dev/null @@ -1,28 +0,0 @@ -path: "tensorflow.estimator.tpu.InputPipelineConfig" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "BROADCAST" - mtype: "" - } - member { - name: "PER_HOST_V1" - mtype: "" - } - member { - name: "PER_HOST_V2" - mtype: "" - } - member { - name: "PER_SHARD_V1" - mtype: "" - } - member { - name: "SLICED" - mtype: "" - } - member_method { - name: "__init__" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-run-config.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-run-config.pbtxt deleted file mode 100644 index f4c2f888de0..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-run-config.pbtxt +++ /dev/null @@ -1,126 +0,0 @@ -path: "tensorflow.estimator.tpu.RunConfig" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "checkpoint_save_graph_def" - mtype: "" - } - member { - name: "cluster" - mtype: "" - } - member { - name: "cluster_spec" - mtype: "" - } - member { - name: "device_fn" - mtype: "" - } - member { - name: "eval_distribute" - mtype: "" - } - member { - name: "evaluation_master" - mtype: "" - } - member { - name: "experimental_max_worker_delay_secs" - mtype: "" - } - member { - name: "global_id_in_cluster" - mtype: "" - } - member { - name: "is_chief" - mtype: "" - } - member { - name: "keep_checkpoint_every_n_hours" - mtype: "" - } - member { - name: "keep_checkpoint_max" - mtype: "" - } - member { - name: "log_step_count_steps" - mtype: "" - } - member { - name: "master" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "num_ps_replicas" - mtype: "" - } - member { - name: "num_worker_replicas" - mtype: "" - } - member { - name: "protocol" - mtype: "" - } - member { - name: "save_checkpoints_secs" - mtype: "" - } - member { - name: "save_checkpoints_steps" - mtype: "" - } - member { - name: "save_summary_steps" - mtype: "" - } - member { - name: "service" - mtype: "" - } - member { - name: "session_config" - mtype: "" - } - member { - name: "session_creation_timeout_secs" - mtype: "" - } - member { - name: "task_id" - mtype: "" - } - member { - name: "task_type" - mtype: "" - } - member { - name: "tf_random_seed" - mtype: "" - } - member { - name: "tpu_config" - mtype: "" - } - member { - name: "train_distribute" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'tpu_config\', \'evaluation_master\', \'master\', \'cluster\'], varargs=None, keywords=kwargs, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "replace" - argspec: "args=[\'self\'], varargs=None, keywords=kwargs, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-t-p-u-config.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-t-p-u-config.pbtxt deleted file mode 100644 index 16f39f9fe2e..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-t-p-u-config.pbtxt +++ /dev/null @@ -1,59 +0,0 @@ -path: "tensorflow.estimator.tpu.TPUConfig" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "eval_training_input_configuration" - mtype: "" - } - member { - name: "experimental_allow_per_host_v2_parallel_get_next" - mtype: "" - } - member { - name: "experimental_feed_hook" - mtype: "" - } - member { - name: "experimental_host_call_every_n_steps" - mtype: "" - } - member { - name: "initial_infeed_sleep_secs" - mtype: "" - } - member { - name: "input_partition_dims" - mtype: "" - } - member { - name: "iterations_per_loop" - mtype: "" - } - member { - name: "num_cores_per_replica" - mtype: "" - } - member { - name: "num_shards" - mtype: "" - } - member { - name: "per_host_input_for_training" - mtype: "" - } - member { - name: "tpu_job_name" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-t-p-u-estimator-spec.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-t-p-u-estimator-spec.pbtxt deleted file mode 100644 index 4fab4f2c177..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-t-p-u-estimator-spec.pbtxt +++ /dev/null @@ -1,64 +0,0 @@ -path: "tensorflow.estimator.tpu.TPUEstimatorSpec" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "eval_metrics" - mtype: "" - } - member { - name: "evaluation_hooks" - mtype: "" - } - member { - name: "export_outputs" - mtype: "" - } - member { - name: "host_call" - mtype: "" - } - member { - name: "loss" - mtype: "" - } - member { - name: "mode" - mtype: "" - } - member { - name: "prediction_hooks" - mtype: "" - } - member { - name: "predictions" - mtype: "" - } - member { - name: "scaffold_fn" - mtype: "" - } - member { - name: "train_op" - mtype: "" - } - member { - name: "training_hooks" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "as_estimator_spec" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-t-p-u-estimator.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-t-p-u-estimator.pbtxt deleted file mode 100644 index 9545f24e6a0..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.-t-p-u-estimator.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.tpu.TPUEstimator" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'model_fn\', \'model_dir\', \'config\', \'params\', \'use_tpu\', \'train_batch_size\', \'eval_batch_size\', \'predict_batch_size\', \'batch_axis\', \'eval_on_tpu\', \'export_to_tpu\', \'export_to_cpu\', \'warm_start_from\', \'embedding_config_spec\', \'export_saved_model_api_version\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'True\', \'None\', \'None\', \'None\', \'None\', \'True\', \'True\', \'True\', \'None\', \'None\', \'ExportSavedModelApiVersion.V1\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.experimental.-embedding-config-spec.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.experimental.-embedding-config-spec.pbtxt deleted file mode 100644 index ebcf27eea53..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.experimental.-embedding-config-spec.pbtxt +++ /dev/null @@ -1,55 +0,0 @@ -path: "tensorflow.estimator.tpu.experimental.EmbeddingConfigSpec" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "clipping_limit" - mtype: "" - } - member { - name: "experimental_gradient_multiplier_fn" - mtype: "" - } - member { - name: "feature_columns" - mtype: "" - } - member { - name: "feature_to_config_dict" - mtype: "" - } - member { - name: "optimization_parameters" - mtype: "" - } - member { - name: "partition_strategy" - mtype: "" - } - member { - name: "pipeline_execution_with_tensor_core" - mtype: "" - } - member { - name: "profile_data_directory" - mtype: "" - } - member { - name: "table_to_config_dict" - mtype: "" - } - member { - name: "tensor_core_feature_columns" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.experimental.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.experimental.pbtxt deleted file mode 100644 index bf423b91d1b..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.experimental.pbtxt +++ /dev/null @@ -1,7 +0,0 @@ -path: "tensorflow.estimator.tpu.experimental" -tf_module { - member { - name: "EmbeddingConfigSpec" - mtype: "" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.pbtxt deleted file mode 100644 index 2d11780c77a..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.estimator.tpu.pbtxt +++ /dev/null @@ -1,27 +0,0 @@ -path: "tensorflow.estimator.tpu" -tf_module { - member { - name: "InputPipelineConfig" - mtype: "" - } - member { - name: "RunConfig" - mtype: "" - } - member { - name: "TPUConfig" - mtype: "" - } - member { - name: "TPUEstimator" - mtype: "" - } - member { - name: "TPUEstimatorSpec" - mtype: "" - } - member { - name: "experimental" - mtype: "" - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.pbtxt index 53006c7f6fe..a4699194cb4 100644 --- a/tensorflow/tools/api/golden/v1/tensorflow.pbtxt +++ b/tensorflow/tools/api/golden/v1/tensorflow.pbtxt @@ -396,10 +396,6 @@ tf_module { name: "errors" mtype: "" } - member { - name: "estimator" - mtype: "" - } member { name: "experimental" mtype: "" diff --git a/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-adagrad-parameters.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-adagrad-parameters.pbtxt deleted file mode 100644 index f56ef6540fc..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-adagrad-parameters.pbtxt +++ /dev/null @@ -1,10 +0,0 @@ -path: "tensorflow.tpu.experimental.AdagradParameters" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'learning_rate\', \'initial_accumulator\', \'use_gradient_accumulation\', \'clip_weight_min\', \'clip_weight_max\', \'weight_decay_factor\', \'multiply_weight_decay_factor_by_learning_rate\', \'clip_gradient_min\', \'clip_gradient_max\'], varargs=None, keywords=None, defaults=[\'0.1\', \'True\', \'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-adam-parameters.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-adam-parameters.pbtxt deleted file mode 100644 index 922f4c3adc1..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-adam-parameters.pbtxt +++ /dev/null @@ -1,10 +0,0 @@ -path: "tensorflow.tpu.experimental.AdamParameters" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'learning_rate\', \'beta1\', \'beta2\', \'epsilon\', \'lazy_adam\', \'sum_inside_sqrt\', \'use_gradient_accumulation\', \'clip_weight_min\', \'clip_weight_max\', \'weight_decay_factor\', \'multiply_weight_decay_factor_by_learning_rate\', \'clip_gradient_min\', \'clip_gradient_max\'], varargs=None, keywords=None, defaults=[\'0.9\', \'0.999\', \'1e-08\', \'True\', \'True\', \'True\', \'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-ftrl-parameters.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-ftrl-parameters.pbtxt deleted file mode 100644 index 648c8340b70..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-ftrl-parameters.pbtxt +++ /dev/null @@ -1,10 +0,0 @@ -path: "tensorflow.tpu.experimental.FtrlParameters" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'learning_rate\', \'learning_rate_power\', \'initial_accumulator_value\', \'l1_regularization_strength\', \'l2_regularization_strength\', \'use_gradient_accumulation\', \'clip_weight_min\', \'clip_weight_max\', \'weight_decay_factor\', \'multiply_weight_decay_factor_by_learning_rate\', \'multiply_linear_by_learning_rate\', \'beta\', \'allow_zero_accumulator\', \'clip_gradient_min\', \'clip_gradient_max\'], varargs=None, keywords=None, defaults=[\'-0.5\', \'0.1\', \'0.0\', \'0.0\', \'True\', \'None\', \'None\', \'None\', \'None\', \'False\', \'0\', \'False\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-stochastic-gradient-descent-parameters.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-stochastic-gradient-descent-parameters.pbtxt deleted file mode 100644 index 200d3ded430..00000000000 --- a/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.-stochastic-gradient-descent-parameters.pbtxt +++ /dev/null @@ -1,10 +0,0 @@ -path: "tensorflow.tpu.experimental.StochasticGradientDescentParameters" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'learning_rate\', \'use_gradient_accumulation\', \'clip_weight_min\', \'clip_weight_max\', \'weight_decay_factor\', \'multiply_weight_decay_factor_by_learning_rate\', \'clip_gradient_min\', \'clip_gradient_max\'], varargs=None, keywords=None, defaults=[\'True\', \'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.pbtxt b/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.pbtxt index ea2de20d038..1b7e73933e6 100644 --- a/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.pbtxt +++ b/tensorflow/tools/api/golden/v1/tensorflow.tpu.experimental.pbtxt @@ -1,13 +1,5 @@ path: "tensorflow.tpu.experimental" tf_module { - member { - name: "AdagradParameters" - mtype: "" - } - member { - name: "AdamParameters" - mtype: "" - } member { name: "DeviceAssignment" mtype: "" @@ -16,18 +8,10 @@ tf_module { name: "DeviceOrderMode" mtype: "" } - member { - name: "FtrlParameters" - mtype: "" - } member { name: "HardwareFeature" mtype: "" } - member { - name: "StochasticGradientDescentParameters" - mtype: "" - } member { name: "TPUSystemMetadata" mtype: "" diff --git a/tensorflow/tools/api/golden/v2/tensorflow.data.experimental.-checkpoint-input-pipeline-hook.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.data.experimental.-checkpoint-input-pipeline-hook.pbtxt deleted file mode 100644 index dc306bc9ce6..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.data.experimental.-checkpoint-input-pipeline-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.data.experimental.CheckpointInputPipelineHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'estimator\', \'external_state_policy\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.data.experimental.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.data.experimental.pbtxt index c9f2b8c690a..e316c1b76e5 100644 --- a/tensorflow/tools/api/golden/v2/tensorflow.data.experimental.pbtxt +++ b/tensorflow/tools/api/golden/v2/tensorflow.data.experimental.pbtxt @@ -16,10 +16,6 @@ tf_module { name: "AutotuneOptions" mtype: "" } - member { - name: "CheckpointInputPipelineHook" - mtype: "" - } member { name: "CsvDataset" mtype: "" diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-baseline-classifier.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-baseline-classifier.pbtxt deleted file mode 100644 index 0672d29cab2..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-baseline-classifier.pbtxt +++ /dev/null @@ -1,63 +0,0 @@ -path: "tensorflow.estimator.BaselineClassifier" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'model_dir\', \'n_classes\', \'weight_column\', \'label_vocabulary\', \'optimizer\', \'config\', \'loss_reduction\'], varargs=None, keywords=None, defaults=[\'None\', \'2\', \'None\', \'None\', \'Ftrl\', \'None\', \'sum_over_batch_size\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-baseline-estimator.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-baseline-estimator.pbtxt deleted file mode 100644 index 5ba9a42e959..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-baseline-estimator.pbtxt +++ /dev/null @@ -1,63 +0,0 @@ -path: "tensorflow.estimator.BaselineEstimator" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'head\', \'model_dir\', \'optimizer\', \'config\'], varargs=None, keywords=None, defaults=[\'None\', \'Ftrl\', \'None\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-baseline-regressor.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-baseline-regressor.pbtxt deleted file mode 100644 index f16b8ebf187..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-baseline-regressor.pbtxt +++ /dev/null @@ -1,63 +0,0 @@ -path: "tensorflow.estimator.BaselineRegressor" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'model_dir\', \'label_dimension\', \'weight_column\', \'optimizer\', \'config\', \'loss_reduction\'], varargs=None, keywords=None, defaults=[\'None\', \'1\', \'None\', \'Ftrl\', \'None\', \'sum_over_batch_size\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-best-exporter.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-best-exporter.pbtxt deleted file mode 100644 index 68145735bd5..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-best-exporter.pbtxt +++ /dev/null @@ -1,18 +0,0 @@ -path: "tensorflow.estimator.BestExporter" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'name\', \'serving_input_receiver_fn\', \'event_file_pattern\', \'compare_fn\', \'assets_extra\', \'as_text\', \'exports_to_keep\'], varargs=None, keywords=None, defaults=[\'best_exporter\', \'None\', \'eval/*.tfevents.*\', \'\', \'None\', \'False\', \'5\'], " - } - member_method { - name: "export" - argspec: "args=[\'self\', \'estimator\', \'export_path\', \'checkpoint_path\', \'eval_result\', \'is_the_final_export\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-binary-class-head.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-binary-class-head.pbtxt deleted file mode 100644 index 3495ab3748c..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-binary-class-head.pbtxt +++ /dev/null @@ -1,42 +0,0 @@ -path: "tensorflow.estimator.BinaryClassHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'weight_column\', \'thresholds\', \'label_vocabulary\', \'loss_reduction\', \'loss_fn\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'sum_over_batch_size\', \'None\', \'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\', \'keys\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-checkpoint-saver-hook.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-checkpoint-saver-hook.pbtxt deleted file mode 100644 index 5c87f49e5a2..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-checkpoint-saver-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.CheckpointSaverHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'checkpoint_dir\', \'save_secs\', \'save_steps\', \'saver\', \'checkpoint_basename\', \'scaffold\', \'listeners\', \'save_graph_def\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'model.ckpt\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-checkpoint-saver-listener.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-checkpoint-saver-listener.pbtxt deleted file mode 100644 index 111b7583f2c..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-checkpoint-saver-listener.pbtxt +++ /dev/null @@ -1,24 +0,0 @@ -path: "tensorflow.estimator.CheckpointSaverListener" -tf_class { - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "after_save" - argspec: "args=[\'self\', \'session\', \'global_step_value\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_save" - argspec: "args=[\'self\', \'session\', \'global_step_value\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\', \'global_step_value\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-classifier.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-classifier.pbtxt deleted file mode 100644 index a38291cc5be..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-classifier.pbtxt +++ /dev/null @@ -1,63 +0,0 @@ -path: "tensorflow.estimator.DNNClassifier" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'hidden_units\', \'feature_columns\', \'model_dir\', \'n_classes\', \'weight_column\', \'label_vocabulary\', \'optimizer\', \'activation_fn\', \'dropout\', \'config\', \'warm_start_from\', \'loss_reduction\', \'batch_norm\'], varargs=None, keywords=None, defaults=[\'None\', \'2\', \'None\', \'None\', \'Adagrad\', \'\', \'None\', \'None\', \'None\', \'sum_over_batch_size\', \'False\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-estimator.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-estimator.pbtxt deleted file mode 100644 index 12a9d227afd..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-estimator.pbtxt +++ /dev/null @@ -1,63 +0,0 @@ -path: "tensorflow.estimator.DNNEstimator" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'head\', \'hidden_units\', \'feature_columns\', \'model_dir\', \'optimizer\', \'activation_fn\', \'dropout\', \'config\', \'warm_start_from\', \'batch_norm\'], varargs=None, keywords=None, defaults=[\'None\', \'Adagrad\', \'\', \'None\', \'None\', \'None\', \'False\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-linear-combined-classifier.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-linear-combined-classifier.pbtxt deleted file mode 100644 index 86a117daf75..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-linear-combined-classifier.pbtxt +++ /dev/null @@ -1,63 +0,0 @@ -path: "tensorflow.estimator.DNNLinearCombinedClassifier" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'model_dir\', \'linear_feature_columns\', \'linear_optimizer\', \'dnn_feature_columns\', \'dnn_optimizer\', \'dnn_hidden_units\', \'dnn_activation_fn\', \'dnn_dropout\', \'n_classes\', \'weight_column\', \'label_vocabulary\', \'config\', \'warm_start_from\', \'loss_reduction\', \'batch_norm\', \'linear_sparse_combiner\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'Ftrl\', \'None\', \'Adagrad\', \'None\', \'\', \'None\', \'2\', \'None\', \'None\', \'None\', \'None\', \'sum_over_batch_size\', \'False\', \'sum\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-linear-combined-estimator.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-linear-combined-estimator.pbtxt deleted file mode 100644 index f0f5bc251a6..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-linear-combined-estimator.pbtxt +++ /dev/null @@ -1,63 +0,0 @@ -path: "tensorflow.estimator.DNNLinearCombinedEstimator" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'head\', \'model_dir\', \'linear_feature_columns\', \'linear_optimizer\', \'dnn_feature_columns\', \'dnn_optimizer\', \'dnn_hidden_units\', \'dnn_activation_fn\', \'dnn_dropout\', \'config\', \'batch_norm\', \'linear_sparse_combiner\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'Ftrl\', \'None\', \'Adagrad\', \'None\', \'\', \'None\', \'None\', \'False\', \'sum\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-linear-combined-regressor.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-linear-combined-regressor.pbtxt deleted file mode 100644 index dd659b42980..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-linear-combined-regressor.pbtxt +++ /dev/null @@ -1,63 +0,0 @@ -path: "tensorflow.estimator.DNNLinearCombinedRegressor" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'model_dir\', \'linear_feature_columns\', \'linear_optimizer\', \'dnn_feature_columns\', \'dnn_optimizer\', \'dnn_hidden_units\', \'dnn_activation_fn\', \'dnn_dropout\', \'label_dimension\', \'weight_column\', \'config\', \'warm_start_from\', \'loss_reduction\', \'batch_norm\', \'linear_sparse_combiner\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'Ftrl\', \'None\', \'Adagrad\', \'None\', \'\', \'None\', \'1\', \'None\', \'None\', \'None\', \'sum_over_batch_size\', \'False\', \'sum\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-regressor.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-regressor.pbtxt deleted file mode 100644 index f293a1d8500..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-d-n-n-regressor.pbtxt +++ /dev/null @@ -1,63 +0,0 @@ -path: "tensorflow.estimator.DNNRegressor" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'hidden_units\', \'feature_columns\', \'model_dir\', \'label_dimension\', \'weight_column\', \'optimizer\', \'activation_fn\', \'dropout\', \'config\', \'warm_start_from\', \'loss_reduction\', \'batch_norm\'], varargs=None, keywords=None, defaults=[\'None\', \'1\', \'None\', \'Adagrad\', \'\', \'None\', \'None\', \'None\', \'sum_over_batch_size\', \'False\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-estimator-spec.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-estimator-spec.pbtxt deleted file mode 100644 index 376becc3f9b..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-estimator-spec.pbtxt +++ /dev/null @@ -1,59 +0,0 @@ -path: "tensorflow.estimator.EstimatorSpec" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "eval_metric_ops" - mtype: "" - } - member { - name: "evaluation_hooks" - mtype: "" - } - member { - name: "export_outputs" - mtype: "" - } - member { - name: "loss" - mtype: "" - } - member { - name: "mode" - mtype: "" - } - member { - name: "prediction_hooks" - mtype: "" - } - member { - name: "predictions" - mtype: "" - } - member { - name: "scaffold" - mtype: "" - } - member { - name: "train_op" - mtype: "" - } - member { - name: "training_chief_hooks" - mtype: "" - } - member { - name: "training_hooks" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-estimator.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-estimator.pbtxt deleted file mode 100644 index 6f44133417e..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-estimator.pbtxt +++ /dev/null @@ -1,62 +0,0 @@ -path: "tensorflow.estimator.Estimator" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'model_fn\', \'model_dir\', \'config\', \'params\', \'warm_start_from\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-eval-spec.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-eval-spec.pbtxt deleted file mode 100644 index 23c2544fe46..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-eval-spec.pbtxt +++ /dev/null @@ -1,43 +0,0 @@ -path: "tensorflow.estimator.EvalSpec" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "exporters" - mtype: "" - } - member { - name: "hooks" - mtype: "" - } - member { - name: "input_fn" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member { - name: "start_delay_secs" - mtype: "" - } - member { - name: "steps" - mtype: "" - } - member { - name: "throttle_secs" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-exporter.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-exporter.pbtxt deleted file mode 100644 index 6c3f0fd9108..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-exporter.pbtxt +++ /dev/null @@ -1,16 +0,0 @@ -path: "tensorflow.estimator.Exporter" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "export" - argspec: "args=[\'self\', \'estimator\', \'export_path\', \'checkpoint_path\', \'eval_result\', \'is_the_final_export\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-feed-fn-hook.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-feed-fn-hook.pbtxt deleted file mode 100644 index f24de493f24..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-feed-fn-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.FeedFnHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'feed_fn\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-final-exporter.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-final-exporter.pbtxt deleted file mode 100644 index e030d401ea4..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-final-exporter.pbtxt +++ /dev/null @@ -1,18 +0,0 @@ -path: "tensorflow.estimator.FinalExporter" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'name\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\'], varargs=None, keywords=None, defaults=[\'None\', \'False\'], " - } - member_method { - name: "export" - argspec: "args=[\'self\', \'estimator\', \'export_path\', \'checkpoint_path\', \'eval_result\', \'is_the_final_export\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-final-ops-hook.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-final-ops-hook.pbtxt deleted file mode 100644 index 6651170ba33..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-final-ops-hook.pbtxt +++ /dev/null @@ -1,34 +0,0 @@ -path: "tensorflow.estimator.FinalOpsHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "final_ops_values" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'final_ops\', \'final_ops_feed_dict\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-global-step-waiter-hook.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-global-step-waiter-hook.pbtxt deleted file mode 100644 index 37db48bc64e..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-global-step-waiter-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.GlobalStepWaiterHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'wait_until_step\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-head.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-head.pbtxt deleted file mode 100644 index 81dab147236..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-head.pbtxt +++ /dev/null @@ -1,40 +0,0 @@ -path: "tensorflow.estimator.Head" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\', \'keys\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-latest-exporter.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-latest-exporter.pbtxt deleted file mode 100644 index d67f2bd625e..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-latest-exporter.pbtxt +++ /dev/null @@ -1,18 +0,0 @@ -path: "tensorflow.estimator.LatestExporter" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'name\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'exports_to_keep\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'5\'], " - } - member_method { - name: "export" - argspec: "args=[\'self\', \'estimator\', \'export_path\', \'checkpoint_path\', \'eval_result\', \'is_the_final_export\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-linear-classifier.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-linear-classifier.pbtxt deleted file mode 100644 index 5c157b4db8e..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-linear-classifier.pbtxt +++ /dev/null @@ -1,63 +0,0 @@ -path: "tensorflow.estimator.LinearClassifier" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'feature_columns\', \'model_dir\', \'n_classes\', \'weight_column\', \'label_vocabulary\', \'optimizer\', \'config\', \'warm_start_from\', \'loss_reduction\', \'sparse_combiner\'], varargs=None, keywords=None, defaults=[\'None\', \'2\', \'None\', \'None\', \'Ftrl\', \'None\', \'None\', \'sum_over_batch_size\', \'sum\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-linear-estimator.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-linear-estimator.pbtxt deleted file mode 100644 index ee3b35aab71..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-linear-estimator.pbtxt +++ /dev/null @@ -1,63 +0,0 @@ -path: "tensorflow.estimator.LinearEstimator" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'head\', \'feature_columns\', \'model_dir\', \'optimizer\', \'config\', \'sparse_combiner\', \'warm_start_from\'], varargs=None, keywords=None, defaults=[\'None\', \'Ftrl\', \'None\', \'sum\', \'None\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-linear-regressor.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-linear-regressor.pbtxt deleted file mode 100644 index bdeb2a80396..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-linear-regressor.pbtxt +++ /dev/null @@ -1,63 +0,0 @@ -path: "tensorflow.estimator.LinearRegressor" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'feature_columns\', \'model_dir\', \'label_dimension\', \'weight_column\', \'optimizer\', \'config\', \'warm_start_from\', \'loss_reduction\', \'sparse_combiner\'], varargs=None, keywords=None, defaults=[\'None\', \'1\', \'None\', \'Ftrl\', \'None\', \'None\', \'sum_over_batch_size\', \'sum\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-logging-tensor-hook.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-logging-tensor-hook.pbtxt deleted file mode 100644 index 425f0167a16..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-logging-tensor-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.LoggingTensorHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'tensors\', \'every_n_iter\', \'every_n_secs\', \'at_end\', \'formatter\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'False\', \'None\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-logistic-regression-head.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-logistic-regression-head.pbtxt deleted file mode 100644 index 7399099f160..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-logistic-regression-head.pbtxt +++ /dev/null @@ -1,43 +0,0 @@ -path: "tensorflow.estimator.LogisticRegressionHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'weight_column\', \'loss_reduction\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'sum_over_batch_size\', \'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-mode-keys.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-mode-keys.pbtxt deleted file mode 100644 index d5375278009..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-mode-keys.pbtxt +++ /dev/null @@ -1,20 +0,0 @@ -path: "tensorflow.estimator.ModeKeys" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "EVAL" - mtype: "" - } - member { - name: "PREDICT" - mtype: "" - } - member { - name: "TRAIN" - mtype: "" - } - member_method { - name: "__init__" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-multi-class-head.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-multi-class-head.pbtxt deleted file mode 100644 index 4629e78c5bf..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-multi-class-head.pbtxt +++ /dev/null @@ -1,42 +0,0 @@ -path: "tensorflow.estimator.MultiClassHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'n_classes\', \'weight_column\', \'label_vocabulary\', \'loss_reduction\', \'loss_fn\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'sum_over_batch_size\', \'None\', \'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\', \'keys\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-multi-head.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-multi-head.pbtxt deleted file mode 100644 index 715471f536e..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-multi-head.pbtxt +++ /dev/null @@ -1,42 +0,0 @@ -path: "tensorflow.estimator.MultiHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'heads\', \'head_weights\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\', \'keys\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-multi-label-head.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-multi-label-head.pbtxt deleted file mode 100644 index 00bff2f14ed..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-multi-label-head.pbtxt +++ /dev/null @@ -1,42 +0,0 @@ -path: "tensorflow.estimator.MultiLabelHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'n_classes\', \'weight_column\', \'thresholds\', \'label_vocabulary\', \'loss_reduction\', \'loss_fn\', \'classes_for_class_based_metrics\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'sum_over_batch_size\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\', \'keys\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-nan-loss-during-training-error.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-nan-loss-during-training-error.pbtxt deleted file mode 100644 index fc37f269220..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-nan-loss-during-training-error.pbtxt +++ /dev/null @@ -1,15 +0,0 @@ -path: "tensorflow.estimator.NanLossDuringTrainingError" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "args" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "add_note" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-nan-tensor-hook.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-nan-tensor-hook.pbtxt deleted file mode 100644 index 82293c2c0c4..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-nan-tensor-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.NanTensorHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'loss_tensor\', \'fail_on_nan_loss\'], varargs=None, keywords=None, defaults=[\'True\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-poisson-regression-head.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-poisson-regression-head.pbtxt deleted file mode 100644 index 834afda2ce6..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-poisson-regression-head.pbtxt +++ /dev/null @@ -1,43 +0,0 @@ -path: "tensorflow.estimator.PoissonRegressionHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'label_dimension\', \'weight_column\', \'loss_reduction\', \'compute_full_loss\', \'name\'], varargs=None, keywords=None, defaults=[\'1\', \'None\', \'sum_over_batch_size\', \'True\', \'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-profiler-hook.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-profiler-hook.pbtxt deleted file mode 100644 index 65b5fb16b08..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-profiler-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.ProfilerHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'save_steps\', \'save_secs\', \'output_dir\', \'show_dataflow\', \'show_memory\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'\', \'True\', \'False\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-regression-head.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-regression-head.pbtxt deleted file mode 100644 index 67960eb0339..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-regression-head.pbtxt +++ /dev/null @@ -1,42 +0,0 @@ -path: "tensorflow.estimator.RegressionHead" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "logits_dimension" - mtype: "" - } - member { - name: "loss_reduction" - mtype: "" - } - member { - name: "name" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'label_dimension\', \'weight_column\', \'loss_reduction\', \'loss_fn\', \'inverse_link_fn\', \'name\'], varargs=None, keywords=None, defaults=[\'1\', \'None\', \'sum_over_batch_size\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "create_estimator_spec" - argspec: "args=[\'self\', \'features\', \'mode\', \'logits\', \'labels\', \'optimizer\', \'trainable_variables\', \'train_op_fn\', \'update_ops\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "loss" - argspec: "args=[\'self\', \'labels\', \'logits\', \'features\', \'mode\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "metrics" - argspec: "args=[\'self\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "predictions" - argspec: "args=[\'self\', \'logits\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "update_metrics" - argspec: "args=[\'self\', \'eval_metrics\', \'features\', \'logits\', \'labels\', \'regularization_losses\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-run-config.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-run-config.pbtxt deleted file mode 100644 index e124a23e9a3..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-run-config.pbtxt +++ /dev/null @@ -1,117 +0,0 @@ -path: "tensorflow.estimator.RunConfig" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "checkpoint_save_graph_def" - mtype: "" - } - member { - name: "cluster_spec" - mtype: "" - } - member { - name: "device_fn" - mtype: "" - } - member { - name: "eval_distribute" - mtype: "" - } - member { - name: "evaluation_master" - mtype: "" - } - member { - name: "experimental_max_worker_delay_secs" - mtype: "" - } - member { - name: "global_id_in_cluster" - mtype: "" - } - member { - name: "is_chief" - mtype: "" - } - member { - name: "keep_checkpoint_every_n_hours" - mtype: "" - } - member { - name: "keep_checkpoint_max" - mtype: "" - } - member { - name: "log_step_count_steps" - mtype: "" - } - member { - name: "master" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "num_ps_replicas" - mtype: "" - } - member { - name: "num_worker_replicas" - mtype: "" - } - member { - name: "protocol" - mtype: "" - } - member { - name: "save_checkpoints_secs" - mtype: "" - } - member { - name: "save_checkpoints_steps" - mtype: "" - } - member { - name: "save_summary_steps" - mtype: "" - } - member { - name: "service" - mtype: "" - } - member { - name: "session_config" - mtype: "" - } - member { - name: "session_creation_timeout_secs" - mtype: "" - } - member { - name: "task_id" - mtype: "" - } - member { - name: "task_type" - mtype: "" - } - member { - name: "tf_random_seed" - mtype: "" - } - member { - name: "train_distribute" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'model_dir\', \'tf_random_seed\', \'save_summary_steps\', \'save_checkpoints_steps\', \'save_checkpoints_secs\', \'session_config\', \'keep_checkpoint_max\', \'keep_checkpoint_every_n_hours\', \'log_step_count_steps\', \'train_distribute\', \'device_fn\', \'protocol\', \'eval_distribute\', \'experimental_distribute\', \'experimental_max_worker_delay_secs\', \'session_creation_timeout_secs\', \'checkpoint_save_graph_def\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'100\', \'\', \'\', \'None\', \'5\', \'10000\', \'100\', \'None\', \'None\', \'None\', \'None\', \'None\', \'None\', \'7200\', \'True\'], " - } - member_method { - name: "replace" - argspec: "args=[\'self\'], varargs=None, keywords=kwargs, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-second-or-step-timer.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-second-or-step-timer.pbtxt deleted file mode 100644 index 64051d2bd6b..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-second-or-step-timer.pbtxt +++ /dev/null @@ -1,26 +0,0 @@ -path: "tensorflow.estimator.SecondOrStepTimer" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'every_secs\', \'every_steps\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], " - } - member_method { - name: "last_triggered_step" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "reset" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "should_trigger_for_step" - argspec: "args=[\'self\', \'step\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "update_last_triggered_step" - argspec: "args=[\'self\', \'step\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-args.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-args.pbtxt deleted file mode 100644 index b375c742946..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-args.pbtxt +++ /dev/null @@ -1,27 +0,0 @@ -path: "tensorflow.estimator.SessionRunArgs" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "feed_dict" - mtype: "" - } - member { - name: "fetches" - mtype: "" - } - member { - name: "options" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-context.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-context.pbtxt deleted file mode 100644 index cb4ac9f50ec..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-context.pbtxt +++ /dev/null @@ -1,25 +0,0 @@ -path: "tensorflow.estimator.SessionRunContext" -tf_class { - is_instance: "" - is_instance: "" - member { - name: "original_args" - mtype: "" - } - member { - name: "session" - mtype: "" - } - member { - name: "stop_requested" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'original_args\', \'session\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "request_stop" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-hook.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-hook.pbtxt deleted file mode 100644 index 54e9ad9ed44..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-hook.pbtxt +++ /dev/null @@ -1,28 +0,0 @@ -path: "tensorflow.estimator.SessionRunHook" -tf_class { - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-values.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-values.pbtxt deleted file mode 100644 index 67881416963..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-session-run-values.pbtxt +++ /dev/null @@ -1,27 +0,0 @@ -path: "tensorflow.estimator.SessionRunValues" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "options" - mtype: "" - } - member { - name: "results" - mtype: "" - } - member { - name: "run_metadata" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-step-counter-hook.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-step-counter-hook.pbtxt deleted file mode 100644 index 4368e04df3f..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-step-counter-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.StepCounterHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'every_n_steps\', \'every_n_secs\', \'output_dir\', \'summary_writer\'], varargs=None, keywords=None, defaults=[\'100\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-stop-at-step-hook.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-stop-at-step-hook.pbtxt deleted file mode 100644 index 938b189a8c3..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-stop-at-step-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.StopAtStepHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'num_steps\', \'last_step\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-summary-saver-hook.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-summary-saver-hook.pbtxt deleted file mode 100644 index 104157315f5..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-summary-saver-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.SummarySaverHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'save_steps\', \'save_secs\', \'output_dir\', \'summary_writer\', \'scaffold\', \'summary_op\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-train-spec.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-train-spec.pbtxt deleted file mode 100644 index 9939469b562..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-train-spec.pbtxt +++ /dev/null @@ -1,31 +0,0 @@ -path: "tensorflow.estimator.TrainSpec" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "hooks" - mtype: "" - } - member { - name: "input_fn" - mtype: "" - } - member { - name: "max_steps" - mtype: "" - } - member { - name: "saving_listeners" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-vocab-info.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-vocab-info.pbtxt deleted file mode 100644 index b6942cb7ed8..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-vocab-info.pbtxt +++ /dev/null @@ -1,43 +0,0 @@ -path: "tensorflow.estimator.VocabInfo" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "axis" - mtype: "" - } - member { - name: "backup_initializer" - mtype: "" - } - member { - name: "new_vocab" - mtype: "" - } - member { - name: "new_vocab_size" - mtype: "" - } - member { - name: "num_oov_buckets" - mtype: "" - } - member { - name: "old_vocab" - mtype: "" - } - member { - name: "old_vocab_size" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-warm-start-settings.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.-warm-start-settings.pbtxt deleted file mode 100644 index dca2c1fe117..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.-warm-start-settings.pbtxt +++ /dev/null @@ -1,31 +0,0 @@ -path: "tensorflow.estimator.WarmStartSettings" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "ckpt_to_initialize_from" - mtype: "" - } - member { - name: "var_name_to_prev_var_name" - mtype: "" - } - member { - name: "var_name_to_vocab_info" - mtype: "" - } - member { - name: "vars_to_warm_start" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-in-memory-evaluator-hook.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-in-memory-evaluator-hook.pbtxt deleted file mode 100644 index 5a2a01cd532..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-in-memory-evaluator-hook.pbtxt +++ /dev/null @@ -1,30 +0,0 @@ -path: "tensorflow.estimator.experimental.InMemoryEvaluatorHook" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'estimator\', \'input_fn\', \'steps\', \'hooks\', \'name\', \'every_n_iter\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'100\'], " - } - member_method { - name: "after_create_session" - argspec: "args=[\'self\', \'session\', \'coord\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "after_run" - argspec: "args=[\'self\', \'run_context\', \'run_values\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "before_run" - argspec: "args=[\'self\', \'run_context\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "begin" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "end" - argspec: "args=[\'self\', \'session\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-linear-s-d-c-a.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-linear-s-d-c-a.pbtxt deleted file mode 100644 index 85292e4d7ed..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-linear-s-d-c-a.pbtxt +++ /dev/null @@ -1,13 +0,0 @@ -path: "tensorflow.estimator.experimental.LinearSDCA" -tf_class { - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - argspec: "args=[\'self\', \'example_id_column\', \'num_loss_partitions\', \'num_table_shards\', \'symmetric_l1_regularization\', \'symmetric_l2_regularization\', \'adaptive\'], varargs=None, keywords=None, defaults=[\'1\', \'None\', \'0.0\', \'1.0\', \'False\'], " - } - member_method { - name: "get_train_step" - argspec: "args=[\'self\', \'state_manager\', \'weight_column_name\', \'loss_type\', \'feature_columns\', \'features\', \'targets\', \'bias_var\', \'global_step\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-r-n-n-classifier.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-r-n-n-classifier.pbtxt deleted file mode 100644 index 7566b4c5051..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-r-n-n-classifier.pbtxt +++ /dev/null @@ -1,67 +0,0 @@ -path: "tensorflow.estimator.experimental.RNNClassifier" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'sequence_feature_columns\', \'context_feature_columns\', \'units\', \'cell_type\', \'rnn_cell_fn\', \'return_sequences\', \'model_dir\', \'n_classes\', \'weight_column\', \'label_vocabulary\', \'optimizer\', \'loss_reduction\', \'sequence_mask\', \'config\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'\', \'None\', \'False\', \'None\', \'2\', \'None\', \'None\', \'Adagrad\', \'sum_over_batch_size\', \'sequence_mask\', \'None\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-r-n-n-estimator.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-r-n-n-estimator.pbtxt deleted file mode 100644 index 5374af48f94..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.-r-n-n-estimator.pbtxt +++ /dev/null @@ -1,66 +0,0 @@ -path: "tensorflow.estimator.experimental.RNNEstimator" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "config" - mtype: "" - } - member { - name: "model_dir" - mtype: "" - } - member { - name: "model_fn" - mtype: "" - } - member { - name: "params" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'head\', \'sequence_feature_columns\', \'context_feature_columns\', \'units\', \'cell_type\', \'rnn_cell_fn\', \'return_sequences\', \'model_dir\', \'optimizer\', \'config\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'\', \'None\', \'False\', \'None\', \'Adagrad\', \'None\'], " - } - member_method { - name: "eval_dir" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "evaluate" - argspec: "args=[\'self\', \'input_fn\', \'steps\', \'hooks\', \'checkpoint_path\', \'name\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } - member_method { - name: "experimental_export_all_saved_models" - argspec: "args=[\'self\', \'export_dir_base\', \'input_receiver_fn_map\', \'assets_extra\', \'as_text\', \'checkpoint_path\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\'], " - } - member_method { - name: "export_saved_model" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'experimental_mode\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'infer\'], " - } - member_method { - name: "export_savedmodel" - argspec: "args=[\'self\', \'export_dir_base\', \'serving_input_receiver_fn\', \'assets_extra\', \'as_text\', \'checkpoint_path\', \'strip_default_attrs\'], varargs=None, keywords=None, defaults=[\'None\', \'False\', \'None\', \'False\'], " - } - member_method { - name: "get_variable_names" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "get_variable_value" - argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "latest_checkpoint" - argspec: "args=[\'self\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "predict" - argspec: "args=[\'self\', \'input_fn\', \'predict_keys\', \'hooks\', \'checkpoint_path\', \'yield_single_examples\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'True\'], " - } - member_method { - name: "train" - argspec: "args=[\'self\', \'input_fn\', \'hooks\', \'steps\', \'max_steps\', \'saving_listeners\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.pbtxt deleted file mode 100644 index 5df3af38f27..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.experimental.pbtxt +++ /dev/null @@ -1,51 +0,0 @@ -path: "tensorflow.estimator.experimental" -tf_module { - member { - name: "InMemoryEvaluatorHook" - mtype: "" - } - member { - name: "LinearSDCA" - mtype: "" - } - member_method { - name: "build_raw_supervised_input_receiver_fn" - argspec: "args=[\'features\', \'labels\', \'default_batch_size\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "call_logit_fn" - argspec: "args=[\'logit_fn\', \'features\', \'mode\', \'params\', \'config\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "make_early_stopping_hook" - argspec: "args=[\'estimator\', \'should_stop_fn\', \'run_every_secs\', \'run_every_steps\'], varargs=None, keywords=None, defaults=[\'60\', \'None\'], " - } - member_method { - name: "make_stop_at_checkpoint_step_hook" - argspec: "args=[\'estimator\', \'last_step\', \'wait_after_file_check_secs\'], varargs=None, keywords=None, defaults=[\'30\'], " - } - member { - name: "RNNClassifier" - mtype: "" - } - member { - name: "RNNEstimator" - mtype: "" - } - member_method { - name: "stop_if_higher_hook" - argspec: "args=[\'estimator\', \'metric_name\', \'threshold\', \'eval_dir\', \'min_steps\', \'run_every_secs\', \'run_every_steps\'], varargs=None, keywords=None, defaults=[\'None\', \'0\', \'60\', \'None\'], " - } - member_method { - name: "stop_if_lower_hook" - argspec: "args=[\'estimator\', \'metric_name\', \'threshold\', \'eval_dir\', \'min_steps\', \'run_every_secs\', \'run_every_steps\'], varargs=None, keywords=None, defaults=[\'None\', \'0\', \'60\', \'None\'], " - } - member_method { - name: "stop_if_no_decrease_hook" - argspec: "args=[\'estimator\', \'metric_name\', \'max_steps_without_decrease\', \'eval_dir\', \'min_steps\', \'run_every_secs\', \'run_every_steps\'], varargs=None, keywords=None, defaults=[\'None\', \'0\', \'60\', \'None\'], " - } - member_method { - name: "stop_if_no_increase_hook" - argspec: "args=[\'estimator\', \'metric_name\', \'max_steps_without_increase\', \'eval_dir\', \'min_steps\', \'run_every_secs\', \'run_every_steps\'], varargs=None, keywords=None, defaults=[\'None\', \'0\', \'60\', \'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-classification-output.__metaclass__.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-classification-output.__metaclass__.pbtxt deleted file mode 100644 index 820afac8e10..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-classification-output.__metaclass__.pbtxt +++ /dev/null @@ -1,14 +0,0 @@ -path: "tensorflow.estimator.export.ClassificationOutput.__metaclass__" -tf_class { - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "mro" - } - member_method { - name: "register" - argspec: "args=[\'cls\', \'subclass\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-classification-output.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-classification-output.pbtxt deleted file mode 100644 index ce486807a47..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-classification-output.pbtxt +++ /dev/null @@ -1,22 +0,0 @@ -path: "tensorflow.estimator.export.ClassificationOutput" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "classes" - mtype: "" - } - member { - name: "scores" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'scores\', \'classes\'], varargs=None, keywords=None, defaults=[\'None\', \'None\'], " - } - member_method { - name: "as_signature_def" - argspec: "args=[\'self\', \'receiver_tensors\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-eval-output.__metaclass__.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-eval-output.__metaclass__.pbtxt deleted file mode 100644 index ce7b697d102..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-eval-output.__metaclass__.pbtxt +++ /dev/null @@ -1,14 +0,0 @@ -path: "tensorflow.estimator.export.EvalOutput.__metaclass__" -tf_class { - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "mro" - } - member_method { - name: "register" - argspec: "args=[\'cls\', \'subclass\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-eval-output.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-eval-output.pbtxt deleted file mode 100644 index 0da3f73851d..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-eval-output.pbtxt +++ /dev/null @@ -1,47 +0,0 @@ -path: "tensorflow.estimator.export.EvalOutput" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "LOSS_NAME" - mtype: "" - } - member { - name: "METRICS_NAME" - mtype: "" - } - member { - name: "METRIC_UPDATE_SUFFIX" - mtype: "" - } - member { - name: "METRIC_VALUE_SUFFIX" - mtype: "" - } - member { - name: "PREDICTIONS_NAME" - mtype: "" - } - member { - name: "loss" - mtype: "" - } - member { - name: "metrics" - mtype: "" - } - member { - name: "predictions" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'loss\', \'predictions\', \'metrics\'], varargs=None, keywords=None, defaults=[\'None\', \'None\', \'None\'], " - } - member_method { - name: "as_signature_def" - argspec: "args=[\'self\', \'receiver_tensors\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-export-output.__metaclass__.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-export-output.__metaclass__.pbtxt deleted file mode 100644 index b811e1f3dab..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-export-output.__metaclass__.pbtxt +++ /dev/null @@ -1,14 +0,0 @@ -path: "tensorflow.estimator.export.ExportOutput.__metaclass__" -tf_class { - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "mro" - } - member_method { - name: "register" - argspec: "args=[\'cls\', \'subclass\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-export-output.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-export-output.pbtxt deleted file mode 100644 index 9775b2cca81..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-export-output.pbtxt +++ /dev/null @@ -1,12 +0,0 @@ -path: "tensorflow.estimator.export.ExportOutput" -tf_class { - is_instance: "" - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "as_signature_def" - argspec: "args=[\'self\', \'receiver_tensors\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-predict-output.__metaclass__.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-predict-output.__metaclass__.pbtxt deleted file mode 100644 index bdfcb9c8882..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-predict-output.__metaclass__.pbtxt +++ /dev/null @@ -1,14 +0,0 @@ -path: "tensorflow.estimator.export.PredictOutput.__metaclass__" -tf_class { - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "mro" - } - member_method { - name: "register" - argspec: "args=[\'cls\', \'subclass\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-predict-output.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-predict-output.pbtxt deleted file mode 100644 index a4389fb998e..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-predict-output.pbtxt +++ /dev/null @@ -1,18 +0,0 @@ -path: "tensorflow.estimator.export.PredictOutput" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "outputs" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'outputs\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "as_signature_def" - argspec: "args=[\'self\', \'receiver_tensors\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-regression-output.__metaclass__.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-regression-output.__metaclass__.pbtxt deleted file mode 100644 index dcd7cbf427e..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-regression-output.__metaclass__.pbtxt +++ /dev/null @@ -1,14 +0,0 @@ -path: "tensorflow.estimator.export.RegressionOutput.__metaclass__" -tf_class { - is_instance: "" - member_method { - name: "__init__" - } - member_method { - name: "mro" - } - member_method { - name: "register" - argspec: "args=[\'cls\', \'subclass\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-regression-output.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-regression-output.pbtxt deleted file mode 100644 index fc7f8447893..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-regression-output.pbtxt +++ /dev/null @@ -1,18 +0,0 @@ -path: "tensorflow.estimator.export.RegressionOutput" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "value" - mtype: "" - } - member_method { - name: "__init__" - argspec: "args=[\'self\', \'value\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "as_signature_def" - argspec: "args=[\'self\', \'receiver_tensors\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-serving-input-receiver.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-serving-input-receiver.pbtxt deleted file mode 100644 index a0371a16635..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-serving-input-receiver.pbtxt +++ /dev/null @@ -1,27 +0,0 @@ -path: "tensorflow.estimator.export.ServingInputReceiver" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "features" - mtype: "" - } - member { - name: "receiver_tensors" - mtype: "" - } - member { - name: "receiver_tensors_alternatives" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-tensor-serving-input-receiver.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-tensor-serving-input-receiver.pbtxt deleted file mode 100644 index da9d05df237..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.-tensor-serving-input-receiver.pbtxt +++ /dev/null @@ -1,27 +0,0 @@ -path: "tensorflow.estimator.export.TensorServingInputReceiver" -tf_class { - is_instance: "" - is_instance: "" - is_instance: "" - member { - name: "features" - mtype: "" - } - member { - name: "receiver_tensors" - mtype: "" - } - member { - name: "receiver_tensors_alternatives" - mtype: "" - } - member_method { - name: "__init__" - } - member_method { - name: "count" - } - member_method { - name: "index" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.pbtxt deleted file mode 100644 index 3fe3d5963c6..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.export.pbtxt +++ /dev/null @@ -1,39 +0,0 @@ -path: "tensorflow.estimator.export" -tf_module { - member { - name: "ClassificationOutput" - mtype: "" - } - member { - name: "EvalOutput" - mtype: "" - } - member { - name: "ExportOutput" - mtype: "" - } - member { - name: "PredictOutput" - mtype: "" - } - member { - name: "RegressionOutput" - mtype: "" - } - member { - name: "ServingInputReceiver" - mtype: "" - } - member { - name: "TensorServingInputReceiver" - mtype: "" - } - member_method { - name: "build_parsing_serving_input_receiver_fn" - argspec: "args=[\'feature_spec\', \'default_batch_size\'], varargs=None, keywords=None, defaults=[\'None\'], " - } - member_method { - name: "build_raw_serving_input_receiver_fn" - argspec: "args=[\'features\', \'default_batch_size\'], varargs=None, keywords=None, defaults=[\'None\'], " - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.estimator.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.estimator.pbtxt deleted file mode 100644 index 708c772121c..00000000000 --- a/tensorflow/tools/api/golden/v2/tensorflow.estimator.pbtxt +++ /dev/null @@ -1,223 +0,0 @@ -path: "tensorflow.estimator" -tf_module { - member { - name: "BaselineClassifier" - mtype: "" - } - member { - name: "BaselineEstimator" - mtype: "" - } - member { - name: "BaselineRegressor" - mtype: "" - } - member { - name: "BestExporter" - mtype: "" - } - member { - name: "BinaryClassHead" - mtype: "" - } - member { - name: "CheckpointSaverHook" - mtype: "" - } - member { - name: "CheckpointSaverListener" - mtype: "" - } - member { - name: "DNNClassifier" - mtype: "" - } - member { - name: "DNNEstimator" - mtype: "" - } - member { - name: "DNNLinearCombinedClassifier" - mtype: "" - } - member { - name: "DNNLinearCombinedEstimator" - mtype: "" - } - member { - name: "DNNLinearCombinedRegressor" - mtype: "" - } - member { - name: "DNNRegressor" - mtype: "" - } - member { - name: "Estimator" - mtype: "" - } - member { - name: "EstimatorSpec" - mtype: "" - } - member { - name: "EvalSpec" - mtype: "" - } - member { - name: "Exporter" - mtype: "" - } - member { - name: "FeedFnHook" - mtype: "" - } - member { - name: "FinalExporter" - mtype: "" - } - member { - name: "FinalOpsHook" - mtype: "" - } - member { - name: "GlobalStepWaiterHook" - mtype: "" - } - member { - name: "Head" - mtype: "" - } - member { - name: "LatestExporter" - mtype: "" - } - member { - name: "LinearClassifier" - mtype: "" - } - member { - name: "LinearEstimator" - mtype: "" - } - member { - name: "LinearRegressor" - mtype: "" - } - member { - name: "LoggingTensorHook" - mtype: "" - } - member { - name: "LogisticRegressionHead" - mtype: "" - } - member { - name: "ModeKeys" - mtype: "" - } - member { - name: "MultiClassHead" - mtype: "" - } - member { - name: "MultiHead" - mtype: "" - } - member { - name: "MultiLabelHead" - mtype: "" - } - member { - name: "NanLossDuringTrainingError" - mtype: "" - } - member { - name: "NanTensorHook" - mtype: "" - } - member { - name: "PoissonRegressionHead" - mtype: "" - } - member { - name: "ProfilerHook" - mtype: "" - } - member { - name: "RegressionHead" - mtype: "" - } - member { - name: "RunConfig" - mtype: "" - } - member { - name: "SecondOrStepTimer" - mtype: "" - } - member { - name: "SessionRunArgs" - mtype: "" - } - member { - name: "SessionRunContext" - mtype: "" - } - member { - name: "SessionRunHook" - mtype: "" - } - member { - name: "SessionRunValues" - mtype: "" - } - member { - name: "StepCounterHook" - mtype: "" - } - member { - name: "StopAtStepHook" - mtype: "" - } - member { - name: "SummarySaverHook" - mtype: "" - } - member { - name: "TrainSpec" - mtype: "" - } - member { - name: "VocabInfo" - mtype: "" - } - member { - name: "WarmStartSettings" - mtype: "" - } - member { - name: "experimental" - mtype: "" - } - member { - name: "export" - mtype: "" - } - member_method { - name: "add_metrics" - argspec: "args=[\'estimator\', \'metric_fn\'], varargs=None, keywords=None, defaults=None" - } - member_method { - name: "classifier_parse_example_spec" - argspec: "args=[\'feature_columns\', \'label_key\', \'label_dtype\', \'label_default\', \'weight_column\'], varargs=None, keywords=None, defaults=[\"\", \'None\', \'None\'], " - } - member_method { - name: "regressor_parse_example_spec" - argspec: "args=[\'feature_columns\', \'label_key\', \'label_dtype\', \'label_default\', \'label_dimension\', \'weight_column\'], varargs=None, keywords=None, defaults=[\"\", \'None\', \'1\', \'None\'], " - } - member_method { - name: "train_and_evaluate" - argspec: "args=[\'estimator\', \'train_spec\', \'eval_spec\'], varargs=None, keywords=None, defaults=None" - } -} diff --git a/tensorflow/tools/api/golden/v2/tensorflow.pbtxt b/tensorflow/tools/api/golden/v2/tensorflow.pbtxt index dc6a97a8d3d..499b340335a 100644 --- a/tensorflow/tools/api/golden/v2/tensorflow.pbtxt +++ b/tensorflow/tools/api/golden/v2/tensorflow.pbtxt @@ -172,10 +172,6 @@ tf_module { name: "errors" mtype: "" } - member { - name: "estimator" - mtype: "" - } member { name: "experimental" mtype: "" diff --git a/tensorflow/tools/api/tests/BUILD b/tensorflow/tools/api/tests/BUILD index a045043dab7..2edf7261637 100644 --- a/tensorflow/tools/api/tests/BUILD +++ b/tensorflow/tools/api/tests/BUILD @@ -38,8 +38,6 @@ py_strict_test( ], deps = [ # copybara:uncomment "//third_party/py/google/protobuf:use_fast_cpp_protos", - # copybara:uncomment "//third_party/py/tensorflow:tensorflow_compat_v1_estimator", - # copybara:uncomment "//third_party/py/tensorflow:tensorflow_compat_v2_estimator", "//tensorflow:tensorflow_py", "//tensorflow/python/lib/io:file_io", "//tensorflow/python/platform:client_testlib", diff --git a/tensorflow/tools/api/tests/api_compatibility_test.py b/tensorflow/tools/api/tests/api_compatibility_test.py index f975536cd81..546eb464b5a 100644 --- a/tensorflow/tools/api/tests/api_compatibility_test.py +++ b/tensorflow/tools/api/tests/api_compatibility_test.py @@ -96,16 +96,10 @@ _TEST_README_FILE = resource_loader.get_path_to_datafile('README.txt') _UPDATE_WARNING_FILE = resource_loader.get_path_to_datafile( 'API_UPDATE_WARNING.txt') -_NON_CORE_PACKAGES = ['estimator', 'keras'] +_NON_CORE_PACKAGES = ['keras'] _V1_APIS_FROM_KERAS = ['layers', 'nn.rnn_cell'] _V2_APIS_FROM_KERAS = ['initializers', 'losses', 'metrics', 'optimizers'] -# TODO(annarev): remove this once we test with newer version of -# estimator that actually has compat v1 version. -if not hasattr(tf.compat.v1, 'estimator'): - tf.compat.v1.estimator = tf.estimator - tf.compat.v2.estimator = tf.estimator - def _KeyToFilePath(key, api_version): """From a given key, construct a filepath. @@ -487,8 +481,6 @@ if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument( '--update_goldens', type=bool, default=False, help=_UPDATE_GOLDENS_HELP) - # TODO(mikecase): Create Estimator's own API compatibility test or - # a more general API compatibility test for use for TF components. parser.add_argument( '--only_test_core_api', type=bool, diff --git a/tensorflow/tools/ci_build/install/install_centos_pip_packages.sh b/tensorflow/tools/ci_build/install/install_centos_pip_packages.sh index 4a63d43ba26..7ae7c48a1b6 100755 --- a/tensorflow/tools/ci_build/install/install_centos_pip_packages.sh +++ b/tensorflow/tools/ci_build/install/install_centos_pip_packages.sh @@ -103,7 +103,3 @@ pip2 install keras-nightly --no-deps pip3 install keras-nightly --no-deps pip2 install --upgrade h5py==2.8.0 pip3 install --upgrade h5py==3.1.0 - -# Estimator -pip2 install tf-estimator-nightly --no-deps -pip3 install tf-estimator-nightly --no-deps diff --git a/tensorflow/tools/ci_build/install/install_pip_packages.sh b/tensorflow/tools/ci_build/install/install_pip_packages.sh index 080bd4c7c67..7bcd9f090ca 100755 --- a/tensorflow/tools/ci_build/install/install_pip_packages.sh +++ b/tensorflow/tools/ci_build/install/install_pip_packages.sh @@ -98,9 +98,6 @@ pip3 install --upgrade termcolor pip3 install keras-nightly --no-deps pip3 install --upgrade h5py==3.1.0 -# Estimator -pip3 install tf-estimator-nightly --no-deps - # Tensorboard pip3 install tb-nightly --no-deps diff --git a/tensorflow/tools/ci_build/install/install_pip_packages_by_version.sh b/tensorflow/tools/ci_build/install/install_pip_packages_by_version.sh index d7fecda9c21..c9ac6c86f60 100755 --- a/tensorflow/tools/ci_build/install/install_pip_packages_by_version.sh +++ b/tensorflow/tools/ci_build/install/install_pip_packages_by_version.sh @@ -76,7 +76,6 @@ PACKAGES=( "tb-nightly" "tblib" "termcolor" - "tf-estimator-nightly" "werkzeug" "wheel" ) diff --git a/tensorflow/tools/ci_build/linux/gpu/run_mkl.sh b/tensorflow/tools/ci_build/linux/gpu/run_mkl.sh index dce347ec3d4..61c9465f1a9 100755 --- a/tensorflow/tools/ci_build/linux/gpu/run_mkl.sh +++ b/tensorflow/tools/ci_build/linux/gpu/run_mkl.sh @@ -31,9 +31,8 @@ KMP_BLOCKTIME="--test_env=KMP_BLOCKTIME=0" #install packages needed -pip install tensorflow-estimator tensorboard -pip install --upgrade tf-estimator-nightly -pip install keras-nightly +pip install tensorboard +pip install keras-nightly pip list diff --git a/tensorflow/tools/ci_build/release/requirements_common.txt b/tensorflow/tools/ci_build/release/requirements_common.txt index da3ea7d765f..f1ce7485a3d 100644 --- a/tensorflow/tools/ci_build/release/requirements_common.txt +++ b/tensorflow/tools/ci_build/release/requirements_common.txt @@ -23,13 +23,12 @@ wrapt ~= 1.14.1 # We need to pin the gast dependency exactly gast == 0.4.0 -# Finally, install tensorboard and estimator and keras +# Finally, install tensorboard and keras # Note that here we want the latest version that matches TF major.minor version # Note that we must use nightly here as these are used in nightly jobs # For release jobs, we will pin these on the release branch keras-nightly ~= 2.14.0.dev tb-nightly ~= 2.14.0.a -tf-estimator-nightly ~= 2.14.0.dev # Test dependencies grpcio ~= 1.59.0 # Earliest version for Python 3.12 diff --git a/tensorflow/tools/compatibility/all_renames_v2.py b/tensorflow/tools/compatibility/all_renames_v2.py index 7520be36fae..6fb040c4c9c 100644 --- a/tensorflow/tools/compatibility/all_renames_v2.py +++ b/tensorflow/tools/compatibility/all_renames_v2.py @@ -29,7 +29,6 @@ manual_symbol_renames = { "tf.batch_gather": "tf.compat.v1.batch_gather", "tf.space_to_batch_nd": "tf.space_to_batch", "tf.nn.space_to_batch": "tf.space_to_batch", - "tf.estimator.inputs": "tf.compat.v1.estimator.inputs", "tf.extract_image_patches": "tf.image.extract_patches", "tf.image.extract_image_patches": "tf.image.extract_patches", "tf.gfile.Copy": "tf.io.gfile.copy", @@ -144,21 +143,6 @@ manual_symbol_renames = { "tf.contrib.distribute.ReductionToOneDeviceCrossDeviceOps": ( "tf.distribute.ReductionToOneDevice" ), - "tf.contrib.estimator.make_early_stopping_hook": ( - "tf.estimator.experimental.make_early_stopping_hook" - ), - "tf.contrib.estimator.stop_if_higher_hook": ( - "tf.estimator.experimental.stop_if_higher_hook" - ), - "tf.contrib.estimator.stop_if_lower_hook": ( - "tf.estimator.experimental.stop_if_lower_hook" - ), - "tf.contrib.estimator.stop_if_no_decrease_hook": ( - "tf.estimator.experimental.stop_if_no_decrease_hook" - ), - "tf.contrib.estimator.stop_if_no_increase_hook": ( - "tf.estimator.experimental.stop_if_no_increase_hook" - ), "tf.contrib.framework.CriticalSection": "tf.CriticalSection", "tf.contrib.framework.is_tensor": "tf.is_tensor", "tf.contrib.framework.load_variable": "tf.train.load_variable", @@ -215,15 +199,6 @@ manual_symbol_renames = { "tf.contrib.tpu.CrossShardOptimizer": ( "tf.compat.v1.tpu.CrossShardOptimizer" ), - "tf.contrib.tpu.InputPipelineConfig": ( - "tf.compat.v1.estimator.tpu.InputPipelineConfig" - ), - "tf.contrib.tpu.RunConfig": "tf.compat.v1.estimator.tpu.RunConfig", - "tf.contrib.tpu.TPUConfig": "tf.compat.v1.estimator.tpu.TPUConfig", - "tf.contrib.tpu.TPUEstimator": "tf.compat.v1.estimator.tpu.TPUEstimator", - "tf.contrib.tpu.TPUEstimatorSpec": ( - "tf.compat.v1.estimator.tpu.TPUEstimatorSpec" - ), "tf.contrib.tpu.batch_parallel": "tf.compat.v1.tpu.batch_parallel", "tf.contrib.tpu.bfloat16_scope": "tf.compat.v1.tpu.bfloat16_scope", "tf.contrib.tpu.core": "tf.compat.v1.tpu.core", diff --git a/tensorflow/tools/compatibility/renames_v2.py b/tensorflow/tools/compatibility/renames_v2.py index 4067b091316..debae39beb4 100644 --- a/tensorflow/tools/compatibility/renames_v2.py +++ b/tensorflow/tools/compatibility/renames_v2.py @@ -312,28 +312,6 @@ renames = { 'tf.math.erf', 'tf.erfc': 'tf.math.erfc', - 'tf.estimator.experimental.KMeans': - 'tf.compat.v1.estimator.experimental.KMeans', - 'tf.estimator.experimental.dnn_logit_fn_builder': - 'tf.compat.v1.estimator.experimental.dnn_logit_fn_builder', - 'tf.estimator.experimental.linear_logit_fn_builder': - 'tf.compat.v1.estimator.experimental.linear_logit_fn_builder', - 'tf.estimator.inputs.numpy_input_fn': - 'tf.compat.v1.estimator.inputs.numpy_input_fn', - 'tf.estimator.inputs.pandas_input_fn': - 'tf.compat.v1.estimator.inputs.pandas_input_fn', - 'tf.estimator.tpu.InputPipelineConfig': - 'tf.compat.v1.estimator.tpu.InputPipelineConfig', - 'tf.estimator.tpu.RunConfig': - 'tf.compat.v1.estimator.tpu.RunConfig', - 'tf.estimator.tpu.TPUConfig': - 'tf.compat.v1.estimator.tpu.TPUConfig', - 'tf.estimator.tpu.TPUEstimator': - 'tf.compat.v1.estimator.tpu.TPUEstimator', - 'tf.estimator.tpu.TPUEstimatorSpec': - 'tf.compat.v1.estimator.tpu.TPUEstimatorSpec', - 'tf.estimator.tpu.experimental.EmbeddingConfigSpec': - 'tf.compat.v1.estimator.tpu.experimental.EmbeddingConfigSpec', 'tf.executing_eagerly_outside_functions': 'tf.compat.v1.executing_eagerly_outside_functions', 'tf.experimental.output_all_intermediates': @@ -528,82 +506,12 @@ renames = { 'tf.compat.v1.keras.utils.get_or_create_layer', 'tf.keras.utils.track_tf1_style_variables': 'tf.compat.v1.keras.utils.track_tf1_style_variables', - 'tf.layers.AveragePooling1D': - 'tf.compat.v1.layers.AveragePooling1D', - 'tf.layers.AveragePooling2D': - 'tf.compat.v1.layers.AveragePooling2D', - 'tf.layers.AveragePooling3D': - 'tf.compat.v1.layers.AveragePooling3D', 'tf.layers.BatchNormalization': 'tf.compat.v1.layers.BatchNormalization', - 'tf.layers.Conv1D': - 'tf.compat.v1.layers.Conv1D', - 'tf.layers.Conv2D': - 'tf.compat.v1.layers.Conv2D', - 'tf.layers.Conv2DTranspose': - 'tf.compat.v1.layers.Conv2DTranspose', - 'tf.layers.Conv3D': - 'tf.compat.v1.layers.Conv3D', - 'tf.layers.Conv3DTranspose': - 'tf.compat.v1.layers.Conv3DTranspose', - 'tf.layers.Dense': - 'tf.compat.v1.layers.Dense', - 'tf.layers.Dropout': - 'tf.compat.v1.layers.Dropout', - 'tf.layers.Flatten': - 'tf.compat.v1.layers.Flatten', 'tf.layers.InputSpec': 'tf.keras.layers.InputSpec', - 'tf.layers.Layer': - 'tf.compat.v1.layers.Layer', - 'tf.layers.MaxPooling1D': - 'tf.compat.v1.layers.MaxPooling1D', - 'tf.layers.MaxPooling2D': - 'tf.compat.v1.layers.MaxPooling2D', - 'tf.layers.MaxPooling3D': - 'tf.compat.v1.layers.MaxPooling3D', - 'tf.layers.SeparableConv1D': - 'tf.compat.v1.layers.SeparableConv1D', - 'tf.layers.SeparableConv2D': - 'tf.compat.v1.layers.SeparableConv2D', - 'tf.layers.average_pooling1d': - 'tf.compat.v1.layers.average_pooling1d', - 'tf.layers.average_pooling2d': - 'tf.compat.v1.layers.average_pooling2d', - 'tf.layers.average_pooling3d': - 'tf.compat.v1.layers.average_pooling3d', 'tf.layers.batch_normalization': 'tf.compat.v1.layers.batch_normalization', - 'tf.layers.conv1d': - 'tf.compat.v1.layers.conv1d', - 'tf.layers.conv2d': - 'tf.compat.v1.layers.conv2d', - 'tf.layers.conv2d_transpose': - 'tf.compat.v1.layers.conv2d_transpose', - 'tf.layers.conv3d': - 'tf.compat.v1.layers.conv3d', - 'tf.layers.conv3d_transpose': - 'tf.compat.v1.layers.conv3d_transpose', - 'tf.layers.dense': - 'tf.compat.v1.layers.dense', - 'tf.layers.dropout': - 'tf.compat.v1.layers.dropout', - 'tf.layers.experimental.keras_style_scope': - 'tf.compat.v1.layers.experimental.keras_style_scope', - 'tf.layers.experimental.set_keras_style': - 'tf.compat.v1.layers.experimental.set_keras_style', - 'tf.layers.flatten': - 'tf.compat.v1.layers.flatten', - 'tf.layers.max_pooling1d': - 'tf.compat.v1.layers.max_pooling1d', - 'tf.layers.max_pooling2d': - 'tf.compat.v1.layers.max_pooling2d', - 'tf.layers.max_pooling3d': - 'tf.compat.v1.layers.max_pooling3d', - 'tf.layers.separable_conv1d': - 'tf.compat.v1.layers.separable_conv1d', - 'tf.layers.separable_conv2d': - 'tf.compat.v1.layers.separable_conv2d', 'tf.lbeta': 'tf.math.lbeta', 'tf.lgamma': @@ -1286,26 +1194,16 @@ renames = { 'tf.compat.v1.summary.TaggedRunMetadata', 'tf.summary.all_v2_summary_ops': 'tf.compat.v1.summary.all_v2_summary_ops', - 'tf.summary.audio': - 'tf.compat.v1.summary.audio', 'tf.summary.get_summary_description': 'tf.compat.v1.summary.get_summary_description', - 'tf.summary.histogram': - 'tf.compat.v1.summary.histogram', - 'tf.summary.image': - 'tf.compat.v1.summary.image', 'tf.summary.initialize': 'tf.compat.v1.summary.initialize', 'tf.summary.merge': 'tf.compat.v1.summary.merge', 'tf.summary.merge_all': 'tf.compat.v1.summary.merge_all', - 'tf.summary.scalar': - 'tf.compat.v1.summary.scalar', 'tf.summary.tensor_summary': 'tf.compat.v1.summary.tensor_summary', - 'tf.summary.text': - 'tf.compat.v1.summary.text', 'tf.svd': 'tf.linalg.svd', 'tf.tables_initializer': @@ -1387,23 +1285,23 @@ renames = { 'tf.train.AdamOptimizer': 'tf.compat.v1.train.AdamOptimizer', 'tf.train.CheckpointSaverHook': - 'tf.estimator.CheckpointSaverHook', + 'tf.compat.v1.train.CheckpointSaverHook', 'tf.train.CheckpointSaverListener': - 'tf.estimator.CheckpointSaverListener', + 'tf.compat.v1.train.CheckpointSaverListener', 'tf.train.ChiefSessionCreator': 'tf.compat.v1.train.ChiefSessionCreator', 'tf.train.FeedFnHook': - 'tf.estimator.FeedFnHook', + 'tf.compat.v1.train.FeedFnHook', 'tf.train.FinalOpsHook': - 'tf.estimator.FinalOpsHook', + 'tf.compat.v1.train.FinalOpsHook', 'tf.train.FtrlOptimizer': 'tf.compat.v1.train.FtrlOptimizer', 'tf.train.GlobalStepWaiterHook': - 'tf.estimator.GlobalStepWaiterHook', + 'tf.compat.v1.train.GlobalStepWaiterHook', 'tf.train.GradientDescentOptimizer': 'tf.compat.v1.train.GradientDescentOptimizer', 'tf.train.LoggingTensorHook': - 'tf.estimator.LoggingTensorHook', + 'tf.compat.v1.train.LoggingTensorHook', 'tf.train.LooperThread': 'tf.compat.v1.train.LooperThread', 'tf.train.MomentumOptimizer': @@ -1413,15 +1311,15 @@ renames = { 'tf.train.MonitoredTrainingSession': 'tf.compat.v1.train.MonitoredTrainingSession', 'tf.train.NanLossDuringTrainingError': - 'tf.estimator.NanLossDuringTrainingError', + 'tf.compat.v1.train.NanLossDuringTrainingError', 'tf.train.NanTensorHook': - 'tf.estimator.NanTensorHook', + 'tf.compat.v1.train.NanTensorHook', 'tf.train.NewCheckpointReader': 'tf.compat.v1.train.NewCheckpointReader', 'tf.train.Optimizer': 'tf.compat.v1.train.Optimizer', 'tf.train.ProfilerHook': - 'tf.estimator.ProfilerHook', + 'tf.compat.v1.train.ProfilerHook', 'tf.train.ProximalAdagradOptimizer': 'tf.compat.v1.train.ProximalAdagradOptimizer', 'tf.train.ProximalGradientDescentOptimizer': @@ -1437,7 +1335,7 @@ renames = { 'tf.train.Scaffold': 'tf.compat.v1.train.Scaffold', 'tf.train.SecondOrStepTimer': - 'tf.estimator.SecondOrStepTimer', + 'tf.compat.v1.train.SecondOrStepTimer', 'tf.train.Server': 'tf.distribute.Server', 'tf.train.SessionCreator': @@ -1445,27 +1343,27 @@ renames = { 'tf.train.SessionManager': 'tf.compat.v1.train.SessionManager', 'tf.train.SessionRunArgs': - 'tf.estimator.SessionRunArgs', + 'tf.compat.v1.train.SessionRunArgs', 'tf.train.SessionRunContext': - 'tf.estimator.SessionRunContext', + 'tf.compat.v1.train.SessionRunContext', 'tf.train.SessionRunHook': - 'tf.estimator.SessionRunHook', + 'tf.compat.v1.train.SessionRunHook', 'tf.train.SessionRunValues': - 'tf.estimator.SessionRunValues', + 'tf.compat.v1.train.SessionRunValues', 'tf.train.SingularMonitoredSession': 'tf.compat.v1.train.SingularMonitoredSession', 'tf.train.StepCounterHook': - 'tf.estimator.StepCounterHook', + 'tf.compat.v1.train.StepCounterHook', 'tf.train.StopAtStepHook': - 'tf.estimator.StopAtStepHook', + 'tf.compat.v1.train.StopAtStepHook', 'tf.train.SummarySaverHook': - 'tf.estimator.SummarySaverHook', + 'tf.compat.v1.train.SummarySaverHook', 'tf.train.Supervisor': 'tf.compat.v1.train.Supervisor', 'tf.train.SyncReplicasOptimizer': 'tf.compat.v1.train.SyncReplicasOptimizer', 'tf.train.VocabInfo': - 'tf.estimator.VocabInfo', + 'tf.compat.v1.train.VocabInfo', 'tf.train.WorkerSessionCreator': 'tf.compat.v1.train.WorkerSessionCreator', 'tf.train.add_queue_runner': diff --git a/tensorflow/tools/compatibility/reorders_v2.py b/tensorflow/tools/compatibility/reorders_v2.py index 99a0d1b4e47..c0ecbc6e8c0 100644 --- a/tensorflow/tools/compatibility/reorders_v2.py +++ b/tensorflow/tools/compatibility/reorders_v2.py @@ -35,14 +35,6 @@ reorders = { 'tf.debugging.assert_all_finite': ['t', 'msg', 'name', 'x', 'message'], 'tf.decode_csv': [None, None, None, None, 'name', 'na_value', 'select_cols'], 'tf.depth_to_space': [None, None, 'name', 'data_format'], - 'tf.estimator.BaselineClassifier': ['model_dir', 'n_classes', 'weight_column', 'label_vocabulary', 'optimizer', 'config', 'loss_reduction'], - 'tf.estimator.BaselineRegressor': ['model_dir', 'label_dimension', 'weight_column', 'optimizer', 'config', 'loss_reduction'], - 'tf.estimator.DNNClassifier': ['hidden_units', 'feature_columns', 'model_dir', 'n_classes', 'weight_column', 'label_vocabulary', 'optimizer', 'activation_fn', 'dropout', 'input_layer_partitioner', 'config', 'warm_start_from', 'loss_reduction', 'batch_norm'], - 'tf.estimator.DNNLinearCombinedClassifier': ['model_dir', 'linear_feature_columns', 'linear_optimizer', 'dnn_feature_columns', 'dnn_optimizer', 'dnn_hidden_units', 'dnn_activation_fn', 'dnn_dropout', 'n_classes', 'weight_column', 'label_vocabulary', 'input_layer_partitioner', 'config', 'warm_start_from', 'loss_reduction', 'batch_norm', 'linear_sparse_combiner'], - 'tf.estimator.DNNLinearCombinedRegressor': ['model_dir', 'linear_feature_columns', 'linear_optimizer', 'dnn_feature_columns', 'dnn_optimizer', 'dnn_hidden_units', 'dnn_activation_fn', 'dnn_dropout', 'label_dimension', 'weight_column', 'input_layer_partitioner', 'config', 'warm_start_from', 'loss_reduction', 'batch_norm', 'linear_sparse_combiner'], - 'tf.estimator.DNNRegressor': ['hidden_units', 'feature_columns', 'model_dir', 'label_dimension', 'weight_column', 'optimizer', 'activation_fn', 'dropout', 'input_layer_partitioner', 'config', 'warm_start_from', 'loss_reduction', 'batch_norm'], - 'tf.estimator.LinearClassifier': ['feature_columns', 'model_dir', 'n_classes', 'weight_column', 'label_vocabulary', 'optimizer', 'config', 'partitioner', 'warm_start_from', 'loss_reduction', 'sparse_combiner'], - 'tf.estimator.LinearRegressor': ['feature_columns', 'model_dir', 'label_dimension', 'weight_column', 'optimizer', 'config', 'partitioner', 'warm_start_from', 'loss_reduction', 'sparse_combiner'], 'tf.feature_column.categorical_column_with_vocabulary_file': [None, None, None, 'num_oov_buckets', 'default_value', 'dtype'], 'tf.gather_nd': [None, None, 'name', 'batch_dims'], 'tf.gradients': [None, None, None, None, 'colocate_gradients_with_ops', 'gate_gradients', 'aggregation_method', 'stop_gradients', 'unconnected_gradients'], @@ -80,7 +72,7 @@ reorders = { 'tf.nn.depth_to_space': [None, None, 'name', 'data_format'], 'tf.nn.depthwise_conv2d': [None, None, None, None, 'rate', 'name', 'data_format', 'dilations'], 'tf.nn.embedding_lookup': [None, None, 'partition_strategy', 'name', 'validate_indices', 'max_norm'], - 'tf.nn.embedding_lookup_sparse': [None, None, None, 'partition_strategy', 'name', 'combiner', 'max_norm'], + 'tf.nn.embedding_lookup_sparse': [None, None, None, 'partition_strategy', 'name', 'combiner', 'max_norm', 'allow_fast_lookup'], 'tf.nn.fractional_avg_pool': ['value', 'pooling_ratio', 'pseudo_random', 'overlapping', 'deterministic', 'seed', 'seed2', 'name'], 'tf.nn.fractional_max_pool': ['value', 'pooling_ratio', 'pseudo_random', 'overlapping', 'deterministic', 'seed', 'seed2', 'name'], 'tf.nn.in_top_k': ['predictions', 'targets', 'k', 'name'], @@ -119,17 +111,17 @@ reorders = { 'tf.sparse.add': [None, None, None, 'thresh'], 'tf.sparse.concat': [None, None, 'name', 'expand_nonconcat_dim', 'concat_dim', 'expand_nonconcat_dims'], 'tf.sparse.reduce_max': [None, None, None, 'reduction_axes', 'keep_dims'], - 'tf.sparse.segment_mean': [None, None, None, 'name', 'num_segments'], - 'tf.sparse.segment_sqrt_n': [None, None, None, 'name', 'num_segments'], - 'tf.sparse.segment_sum': [None, None, None, 'name', 'num_segments'], + 'tf.sparse.segment_mean': [None, None, None, 'name', 'num_segments', 'sparse_gradient'], + 'tf.sparse.segment_sqrt_n': [None, None, None, 'name', 'num_segments', 'sparse_gradient'], + 'tf.sparse.segment_sum': [None, None, None, 'name', 'num_segments', 'sparse_gradient'], 'tf.sparse.split': ['keyword_required', 'sp_input', 'num_split', 'axis', 'name', 'split_dim'], 'tf.sparse_add': [None, None, None, 'thresh'], 'tf.sparse_concat': [None, None, 'name', 'expand_nonconcat_dim', 'concat_dim', 'expand_nonconcat_dims'], 'tf.sparse_matmul': [None, None, None, None, 'a_is_sparse', 'b_is_sparse', 'name'], 'tf.sparse_reduce_max': [None, None, None, 'reduction_axes', 'keep_dims'], - 'tf.sparse_segment_mean': [None, None, None, 'name', 'num_segments'], - 'tf.sparse_segment_sqrt_n': [None, None, None, 'name', 'num_segments'], - 'tf.sparse_segment_sum': [None, None, None, 'name', 'num_segments'], + 'tf.sparse_segment_mean': [None, None, None, 'name', 'num_segments', 'sparse_gradient'], + 'tf.sparse_segment_sqrt_n': [None, None, None, 'name', 'num_segments', 'sparse_gradient'], + 'tf.sparse_segment_sum': [None, None, None, 'name', 'num_segments', 'sparse_gradient'], 'tf.sparse_split': ['keyword_required', 'sp_input', 'num_split', 'axis', 'name', 'split_dim'], 'tf.strings.length': [None, 'name', 'unit'], 'tf.strings.reduce_join': [None, None, 'keep_dims', 'separator', 'name', 'reduction_indices', 'keepdims'], diff --git a/tensorflow/tools/compatibility/tf_upgrade_v2.py b/tensorflow/tools/compatibility/tf_upgrade_v2.py index b6632d28894..11c56830f7e 100644 --- a/tensorflow/tools/compatibility/tf_upgrade_v2.py +++ b/tensorflow/tools/compatibility/tf_upgrade_v2.py @@ -654,14 +654,6 @@ class TFAPIChangeSpec(ast_edits.NoUpdateSpec): "tf.hessians", "tf.nn.max_pool", "tf.nn.avg_pool", - "tf.estimator.LinearClassifier", - "tf.estimator.LinearRegressor", - "tf.estimator.DNNLinearCombinedClassifier", - "tf.estimator.DNNLinearCombinedRegressor", - "tf.estimator.DNNRegressor", - "tf.estimator.DNNClassifier", - "tf.estimator.BaselineClassifier", - "tf.estimator.BaselineRegressor", "tf.initializers.uniform_unit_scaling", "tf.uniform_unit_scaling_initializer", "tf.data.experimental.TensorStructure", @@ -727,14 +719,6 @@ class TFAPIChangeSpec(ast_edits.NoUpdateSpec): "Please check the new API and use that instead." ) - contrib_estimator_head_comment = ( - ast_edits.WARNING, - "(Manual edit required) `tf.contrib.estimator.*_head` has been " - "deprecated, and its implementation has been integrated with " - "`tf.estimator.*Head` in TensorFlow 2.0. " - "Please check the new API and use that instead." - ) - initializers_no_dtype_comment = ( ast_edits.INFO, "Initializers no longer have the " "dtype argument in the constructor or partition_info argument in the " @@ -768,17 +752,6 @@ class TFAPIChangeSpec(ast_edits.NoUpdateSpec): " tf.initializers.variance_scaling instead with distribution=uniform " "to get equivalent behaviour.") - # Make change instead (issue warning about strip_...) - export_saved_model_renamed = ( - ast_edits.ERROR, - "(Manual edit required) Please rename the method export_savedmodel() " - "to export_saved_model(). Two things to note:\n\t(1) The argument " - "strip_default_attributes has been removed. The function will always " - "strip the default attributes from ops. If this breaks your code, " - "please switch to tf.compat.v1.estimator.Estimator.\n\t(2) This change " - "only effects core estimator. If you are using " - "tf.contrib.learn.Estimator, please switch to using core estimator.") - summary_api_comment = ( ast_edits.INFO, "The TF 1.x summary API cannot be automatically migrated to TF 2.0, so " @@ -916,8 +889,6 @@ class TFAPIChangeSpec(ast_edits.NoUpdateSpec): # You can use *. to add items which do not check the FQN, and apply to e.g., # methods. self.function_warnings = { - "*.export_savedmodel": - export_saved_model_renamed, "*.save": keras_default_save_format_comment, "tf.assert_equal": @@ -956,20 +927,6 @@ class TFAPIChangeSpec(ast_edits.NoUpdateSpec): assert_rank_comment, "tf.contrib.layers.layer_norm": contrib_layers_layer_norm_comment, - "tf.contrib.estimator.binary_classification_head": - contrib_estimator_head_comment, - "tf.contrib.estimator.logistic_regression_head": - contrib_estimator_head_comment, - "tf.contrib.estimator.multi_class_head": - contrib_estimator_head_comment, - "tf.contrib.estimator.multi_head": - contrib_estimator_head_comment, - "tf.contrib.estimator.multi_label_head": - contrib_estimator_head_comment, - "tf.contrib.estimator.poisson_regression_head": - contrib_estimator_head_comment, - "tf.contrib.estimator.regression_head": - contrib_estimator_head_comment, "tf.contrib.saved_model.load_keras_model": keras_experimental_export_comment, "tf.contrib.saved_model.save_keras_model": @@ -1056,12 +1013,6 @@ class TFAPIChangeSpec(ast_edits.NoUpdateSpec): deprecate_partition_strategy_comment, "tf.nn.sampled_softmax_loss": deprecate_partition_strategy_comment, - "tf.keras.estimator.model_to_estimator": - (ast_edits.WARNING, - "Estimators from will save object-based " - "checkpoints (format used by `keras_model.save_weights` and " - "`keras_model.load_weights`) by default in 2.0. To continue " - "saving name-based checkpoints, set `checkpoint_format='saver'`."), "tf.keras.experimental.export_saved_model": keras_experimental_export_comment, "tf.keras.experimental.load_from_saved_model": @@ -1440,16 +1391,6 @@ class TFAPIChangeSpec(ast_edits.NoUpdateSpec): # After modifying this dict, run the following to update reorders_v2.py: # bazel run tensorflow/tools/compatibility/update:generate_v2_reorders_map # pylint: enable=line-too-long - canned_estimator_msg_optimizer = ( - "tf.keras.optimizers.* only, so the call was converted to compat.v1. " - "Please note that tf.train.Optimizers have one-to-one correspondents " - "in tf.keras.optimizers, so you may be able to convert to the new " - "optimizers directly (See https://www.tensorflow.org/api_docs/python" - "/tf/keras/optimizers). Checkpoint compatibility is not guaranteed, " - "but there is a checkpoint converter tool that you can use.") - canned_estimator_msg = ( - "no longer takes `input_layer_partitioner` arg, and it supports " - + canned_estimator_msg_optimizer) self.function_transformers = { "*.make_initializable_iterator": _iterator_transformer, "*.make_one_shot_iterator": _iterator_transformer, @@ -1474,95 +1415,6 @@ class TFAPIChangeSpec(ast_edits.NoUpdateSpec): # TODO(b/129398290) # "tf.string_split": _string_split_transformer, "tf.strings.split": _string_split_rtype_transformer, - "tf.estimator.BaselineEstimator": - functools.partial( - _rename_if_arg_found_transformer, - arg_name="optimizer", - message=("tf.estimator.BaselineEstimator supports " - + canned_estimator_msg_optimizer), - ), - "tf.estimator.BaselineClassifier": - functools.partial( - _rename_if_arg_found_and_add_loss_reduction_transformer, - arg_names=["optimizer"], - message=("tf.estimator.BaselineClassifier supports " - + canned_estimator_msg_optimizer), - ), - "tf.estimator.BaselineRegressor": - functools.partial( - _rename_if_arg_found_and_add_loss_reduction_transformer, - arg_names=["input_layer_partitioner", "optimizer"], - message=("tf.estimator.BaselineRegressor supports " - + canned_estimator_msg_optimizer), - ), - "tf.estimator.DNNEstimator": - functools.partial( - _rename_if_any_arg_found_transformer, - arg_names=["input_layer_partitioner", "optimizer"], - message="tf.estimator.DNNEstimator no longer takes " - "input_layer_partitioner, so the call was converted to " - "compat.v1." - ), - "tf.estimator.DNNClassifier": - functools.partial( - _rename_if_arg_found_and_add_loss_reduction_transformer, - arg_names=["input_layer_partitioner", "optimizer"], - message="tf.estimator.DNNClassifier " + canned_estimator_msg, - ), - "tf.estimator.DNNRegressor": - functools.partial( - _rename_if_arg_found_and_add_loss_reduction_transformer, - arg_names=["input_layer_partitioner", "optimizer"], - message="tf.estimator.DNNRegressor " + canned_estimator_msg, - ), - "tf.estimator.LinearEstimator": - functools.partial( - _rename_if_any_arg_found_transformer, - arg_names=["input_layer_partitioner", "optimizer"], - message="tf.estimator.LinearEstimator " + canned_estimator_msg, - ), - "tf.estimator.LinearClassifier": - functools.partial( - _rename_if_arg_found_and_add_loss_reduction_transformer, - arg_names=["input_layer_partitioner", "optimizer"], - message="tf.estimator.LinearClassifier " + canned_estimator_msg, - ), - "tf.estimator.LinearRegressor": - functools.partial( - _rename_if_arg_found_and_add_loss_reduction_transformer, - arg_names=["input_layer_partitioner", "optimizer"], - message="tf.estimator.LinearRegressor " + canned_estimator_msg, - ), - "tf.estimator.DNNLinearCombinedEstimator": - functools.partial( - _rename_if_any_arg_found_transformer, - arg_names=[ - "input_layer_partitioner", "dnn_optimizer", - "linear_optimizer" - ], - message=("tf.estimator.DNNLinearCombinedEstimator " - + canned_estimator_msg), - ), - "tf.estimator.DNNLinearCombinedClassifier": - functools.partial( - _rename_if_arg_found_and_add_loss_reduction_transformer, - arg_names=[ - "input_layer_partitioner", "dnn_optimizer", - "linear_optimizer" - ], - message=("tf.estimator.DNNLinearCombinedClassifier " - + canned_estimator_msg), - ), - "tf.estimator.DNNLinearCombinedRegressor": - functools.partial( - _rename_if_arg_found_and_add_loss_reduction_transformer, - arg_names=[ - "input_layer_partitioner", "dnn_optimizer", - "linear_optimizer" - ], - message=("tf.estimator.DNNLinearCombinedRegressor " - + canned_estimator_msg), - ), "tf.device": functools.partial( _rename_if_arg_found_transformer, arg_name="device_name", arg_ok_predicate=_is_ast_str, remove_if_ok=False, @@ -2110,31 +1962,6 @@ def _add_summary_recording_cond_transformer(parent, node, full_name, name, logs, return node -def _add_loss_reduction_transformer(parent, node, full_name, name, logs): - """Adds a loss_reduction argument if not specified. - - Default value for tf.estimator.*Classifier and tf.estimator.*Regressor - loss_reduction argument changed to SUM_OVER_BATCH_SIZE. So, we update - existing calls to use the old default value `tf.keras.losses.Reduction.SUM`. - - Note: to apply this transformation, symbol must be added - to reordered_function_names above. - """ - for keyword_arg in node.keywords: - if keyword_arg.arg == "loss_reduction": - return node - default_value = "tf.keras.losses.Reduction.SUM" - # Parse with pasta instead of ast to avoid emitting a spurious trailing \n. - ast_value = pasta.parse(default_value) - node.keywords.append(ast.keyword(arg="loss_reduction", value=ast_value)) - logs.append(( - ast_edits.INFO, node.lineno, node.col_offset, - "%s: Default value of loss_reduction has been changed to " - "SUM_OVER_BATCH_SIZE; inserting old default value %s.\n" - % (full_name or name, default_value))) - return node - - def _rename_if_any_arg_found_transformer( parent, node, @@ -2204,7 +2031,6 @@ def _rename_if_arg_found_and_add_loss_reduction_transformer( node, if it was modified, else None. """ - node = _add_loss_reduction_transformer(parent, node, full_name, name, logs) for arg_name in arg_names: rename_node = _rename_if_arg_found_transformer(parent, node, full_name, name, logs, arg_name, diff --git a/tensorflow/tools/compatibility/tf_upgrade_v2_test.py b/tensorflow/tools/compatibility/tf_upgrade_v2_test.py index 5099dd0697e..f848398b5ed 100644 --- a/tensorflow/tools/compatibility/tf_upgrade_v2_test.py +++ b/tensorflow/tools/compatibility/tf_upgrade_v2_test.py @@ -179,10 +179,7 @@ class TestUpgrade(test_util.TensorFlowTestCase, parameterized.TestCase): not text.startswith("tf.compat.v2") and text not in self.v2_symbols and # Ignore any symbol that contains __internal__ - "__internal__" not in text and - # Builds currently install old version of estimator that doesn't - # have some 2.0 symbols. - not text.startswith("tf.estimator")): + "__internal__" not in text): self.assertFalse( True, "Symbol %s generated from %s not in v2 API" % ( text, name)) @@ -210,7 +207,6 @@ class TestUpgrade(test_util.TensorFlowTestCase, parameterized.TestCase): if (text and not text.startswith("tf.compat.v1") and not text.startswith("tf.compat.v2") and - not text.startswith("tf.estimator") and text not in v1_symbols): self.assertFalse( True, "Symbol %s generated from %s not in v1 API" % ( @@ -687,169 +683,6 @@ bazel run tensorflow/tools/compatibility/update:generate_v2_reorders_map self.assertIn( "tf.losses have been replaced with object oriented versions", report) - def testEstimatorLossReductionChange(self): - classes = [ - "LinearClassifier", "LinearRegressor", "DNNLinearCombinedClassifier", - "DNNLinearCombinedRegressor", "DNNRegressor", "DNNClassifier", - "BaselineClassifier", "BaselineRegressor" - ] - for c in classes: - ns = "tf.estimator." + c - text = ns + "()" - expected_text = ns + "(loss_reduction=tf.keras.losses.Reduction.SUM)" - _, report, errors, new_text = self._upgrade(text) - self.assertEqual(expected_text, new_text) - - text = ns + "(loss_reduction=TEST)" - expected_text = ns + "(loss_reduction=TEST)" - _, report, errors, new_text = self._upgrade(text) - self.assertEqual(text, new_text) - text = "tf.estimator.BaselineClassifier(m, c, w, v, o, c, lr)" - expected_text = ( - "tf.compat.v1.estimator.BaselineClassifier(" - "model_dir=m, n_classes=c, weight_column=w, label_vocabulary=v, " - "optimizer=o, config=c, loss_reduction=lr)") - _, report, errors, new_text = self._upgrade(text) - self.assertEqual(expected_text, new_text) - - text = "tf.estimator.BaselineClassifier(model_dir=model_dir)" - expected_text = ("tf.estimator.BaselineClassifier(" + - "model_dir=model_dir, " - "loss_reduction=tf.keras.losses.Reduction.SUM)") - _, report, errors, new_text = self._upgrade(text) - self.assertEqual(expected_text, new_text) - - def testBaseEstimatorPartitioner(self): - classes = ["LinearEstimator", "DNNLinearCombinedEstimator", "DNNEstimator"] - for c in classes: - ns = "tf.estimator." + c - suffix = "(input_layer_partitioner=TEST)" - text = ns + suffix - expected_text = "tf.compat.v1.estimator." + c + suffix - _, unused_report, unused_errors, new_text = self._upgrade(text) - self.assertEqual(new_text, expected_text) - - def testCannedEstimatorPartitioner(self): - classes = [ - "LinearClassifier", "LinearRegressor", "DNNLinearCombinedClassifier", - "DNNLinearCombinedRegressor", "DNNRegressor", "DNNClassifier" - ] - - for c in classes: - ns = "tf.estimator." + c - suffix = "(input_layer_partitioner=TEST)" - text = ns + suffix - suffix = ("(input_layer_partitioner=TEST, " - "loss_reduction=tf.keras.losses.Reduction.SUM)") - expected_text = "tf.compat.v1.estimator." + c + suffix - _, unused_report, unused_errors, new_text = self._upgrade(text) - self.assertEqual(new_text, expected_text) - - def testBaseEstimatorOptimizer(self): - classes = ["BaselineEstimator", "LinearEstimator", "DNNEstimator"] - for c in classes: - ns = "tf.estimator." + c - suffix = "(optimizer=TEST)" - text = ns + suffix - expected_text = "tf.compat.v1.estimator." + c + suffix - _, unused_report, unused_errors, new_text = self._upgrade(text) - self.assertEqual(new_text, expected_text) - - def testDNNLinearCombinedEstimatorOptimizer(self): - classes = ["DNNLinearCombinedEstimator"] - for c in classes: - ns = "tf.estimator." + c - suffix = "(dnn_optimizer=TEST, linear_optimizer=Test)" - text = ns + suffix - expected_text = "tf.compat.v1.estimator." + c + suffix - _, unused_report, unused_errors, new_text = self._upgrade(text) - self.assertEqual(new_text, expected_text) - - def testCannedEstimatorOptimizer(self): - classes = [ - "BaselineClassifier", "BaselineRegressor", "LinearClassifier", - "LinearRegressor", "DNNRegressor", "DNNClassifier" - ] - - for c in classes: - ns = "tf.estimator." + c - suffix = "(optimizer=TEST)" - text = ns + suffix - suffix = ("(optimizer=TEST, " - "loss_reduction=tf.keras.losses.Reduction.SUM)") - expected_text = "tf.compat.v1.estimator." + c + suffix - _, unused_report, unused_errors, new_text = self._upgrade(text) - self.assertEqual(new_text, expected_text) - - def testDNNLinearCombinedOptimizer(self): - classes = [ - "DNNLinearCombinedClassifier", - "DNNLinearCombinedRegressor", - ] - for c in classes: - ns = "tf.estimator." + c - suffix = "(dnn_optimizer=TEST, linear_optimizer=Test)" - text = ns + suffix - suffix = ("(dnn_optimizer=TEST, linear_optimizer=Test, " - "loss_reduction=tf.keras.losses.Reduction.SUM)") - expected_text = "tf.compat.v1.estimator." + c + suffix - _, unused_report, unused_errors, new_text = self._upgrade(text) - self.assertEqual(new_text, expected_text) - - def testBaseEstimatorPartitionerAndOptimizer(self): - classes = ["LinearEstimator", "DNNEstimator"] - for c in classes: - ns = "tf.estimator." + c - suffix = "(input_layer_partitioner=TEST, optimizer=TEST)" - text = ns + suffix - expected_text = "tf.compat.v1.estimator." + c + suffix - _, unused_report, unused_errors, new_text = self._upgrade(text) - self.assertEqual(new_text, expected_text) - - def testDNNLinearCombinedEstimatorPartitionerAndOptimizer(self): - classes = ["DNNLinearCombinedEstimator"] - for c in classes: - ns = "tf.estimator." + c - suffix = ("(input_layer_partitioner=TEST, dnn_optimizer=TEST, " - "linear_optimizer=TEST)") - text = ns + suffix - expected_text = "tf.compat.v1.estimator." + c + suffix - _, unused_report, unused_errors, new_text = self._upgrade(text) - self.assertEqual(new_text, expected_text) - - def testCannedEstimatorPartitionerAndOptimizer(self): - classes = [ - "LinearClassifier", "LinearRegressor", "DNNRegressor", "DNNClassifier" - ] - - for c in classes: - ns = "tf.estimator." + c - suffix = "(input_layer_partitioner=TEST, optimizer=TEST)" - text = ns + suffix - suffix = ("(input_layer_partitioner=TEST, optimizer=TEST, " - "loss_reduction=tf.keras.losses.Reduction.SUM)") - expected_text = "tf.compat.v1.estimator." + c + suffix - _, unused_report, unused_errors, new_text = self._upgrade(text) - self.assertEqual(new_text, expected_text) - - def testDNNLinearCombinedPartitionerAndOptimizer(self): - classes = [ - "DNNLinearCombinedClassifier", - "DNNLinearCombinedRegressor", - ] - - for c in classes: - ns = "tf.estimator." + c - suffix = ("(input_layer_partitioner=TEST, dnn_optimizer=TEST, " - "linear_optimizer=TEST)") - text = ns + suffix - suffix = ("(input_layer_partitioner=TEST, dnn_optimizer=TEST, " - "linear_optimizer=TEST, " - "loss_reduction=tf.keras.losses.Reduction.SUM)") - expected_text = "tf.compat.v1.estimator." + c + suffix - _, unused_report, unused_errors, new_text = self._upgrade(text) - self.assertEqual(new_text, expected_text) - def testExtractGlimpse(self): text = ("tf.image.extract_glimpse(x, size, off, False, " "False, False, name=\"foo\")\n") @@ -1120,13 +953,6 @@ bazel run tensorflow/tools/compatibility/update:generate_v2_reorders_map self.assertEqual("tf.hessians(ys=a, xs=b)\n", new_text) self.assertIn("tf.hessians no longer takes", report) - def testExportSavedModelRename(self): - text = "self.est.export_savedmodel(path)" - _, report, unused_errors, unused_new_text = self._upgrade(text) - self.assertIn( - "rename the method export_savedmodel() to export_saved_model()", - report) - def testArgmin(self): text = "tf.argmin(input, name=n, dimension=1, output_type=type)" expected_text = "tf.argmin(input, name=n, axis=1, output_type=type)" @@ -1181,17 +1007,6 @@ bazel run tensorflow/tools/compatibility/update:generate_v2_reorders_map _, unused_report, unused_errors, new_text = self._upgrade(text) self.assertEqual(new_text, expected_text) - def testEstimatorInputs(self): - text = "tf.estimator.inputs.numpy_input_fn(0)" - expected_text = "tf.compat.v1.estimator.inputs.numpy_input_fn(0)" - _, unused_report, unused_errors, new_text = self._upgrade(text) - self.assertEqual(new_text, expected_text) - - text = "tf.estimator.inputs.pandas_input_fn(0)" - expected_text = "tf.compat.v1.estimator.inputs.pandas_input_fn(0)" - _, unused_report, unused_errors, new_text = self._upgrade(text) - self.assertEqual(new_text, expected_text) - def testBatchToSpace(self): text = "tf.batch_to_space_nd(input, block_shape, crops, name)" expected_text = "tf.batch_to_space(input, block_shape, crops, name)" @@ -1694,17 +1509,6 @@ def _log_prob(self, x): _, _, errors, _ = self._upgrade("tf.flags.FLAGS") self.assertIn("tf.flags and tf.app.flags have been removed", errors[0]) - def test_contrib_estimator_head_deprecation(self): - for contrib_alias in ["tf.contrib.", "contrib_"]: - api_symbols = ["binary_classification_head", "logistic_regression_head", - "multi_class_head", "multi_head", "multi_label_head", - "poisson_regression_head", "regression_head"] - for symbol in api_symbols: - text = contrib_alias + "estimator." + symbol - _, report, _, _ = self._upgrade(text) - self.assertIn("`tf.contrib.estimator.*_head` has been deprecated", - report) - def test_contrib_layers_layer_norm_deprecation(self): for contrib_alias in ["tf.contrib.", "contrib_"]: _, report, _, _ = self._upgrade(contrib_alias + "layers.layer_norm") @@ -1725,19 +1529,6 @@ def _log_prob(self, x): _, _, _, new_text = self._upgrade(text) self.assertEqual(expected_text, new_text) - def test_contrib_estimator_early_stopping(self): - for contrib_alias in ["tf.contrib.", "contrib_"]: - api_symbols = [ - "make_early_stopping_hook", "stop_if_higher_hook", - "stop_if_lower_hook", - "stop_if_no_decrease_hook", "stop_if_no_increase_hook" - ] - for symbol in api_symbols: - text = contrib_alias + "estimator." + symbol - expected_text = "tf.estimator.experimental." + symbol - _, _, _, new_text = self._upgrade(text) - self.assertEqual(expected_text, new_text) - def test_contrib_rnn_cell(self): api_symbols = ["RNNCell", "BasicLSTMCell", "BasicRNNCell", "GRUCell", "LSTMCell", "MultiRNNCell"] @@ -2393,12 +2184,6 @@ def _log_prob(self, x): self.assertEqual(result_a[3], expected_text_a) self.assertEqual(result_b[3], expected_text_b) - def test_model_to_estimator_checkpoint_warning(self): - text = "tf.keras.estimator.model_to_estimator(model)" - _, report, _, _ = self._upgrade(text) - expected_info = "will save object-based checkpoints" - self.assertIn(expected_info, report) - def test_keras_experimental_export_warning(self): text = "tf.keras.experimental.export_saved_model" _, report, _, _ = self._upgrade(text) diff --git a/tensorflow/tools/compatibility/update/BUILD b/tensorflow/tools/compatibility/update/BUILD index f545e7d374e..39ad33ed4c0 100644 --- a/tensorflow/tools/compatibility/update/BUILD +++ b/tensorflow/tools/compatibility/update/BUILD @@ -12,10 +12,7 @@ py_strict_binary( python_version = "PY3", srcs_version = "PY3", deps = [ - "@absl_py//absl:app", "//tensorflow:tensorflow_py", - # copybara:uncomment "//third_party/py/tensorflow:tensorflow_compat_v1_estimator", - # copybara:uncomment "//third_party/py/tensorflow:tensorflow_compat_v2_estimator", "//tensorflow/python:modules_with_exports", "//tensorflow/python:no_contrib", "//tensorflow/python/lib/io:file_io", @@ -24,6 +21,7 @@ py_strict_binary( "//tensorflow/tools/common:public_api", "//tensorflow/tools/common:traverse", "//tensorflow/tools/compatibility:all_renames_v2", + "@absl_py//absl:app", ], ) @@ -33,10 +31,7 @@ py_strict_binary( python_version = "PY3", srcs_version = "PY3", deps = [ - "@absl_py//absl:app", "//tensorflow:tensorflow_py", - # copybara:uncomment "//third_party/py/tensorflow:tensorflow_compat_v1_estimator", - # copybara:uncomment "//third_party/py/tensorflow:tensorflow_compat_v2_estimator", "//tensorflow/python:no_contrib", "//tensorflow/python/lib/io:file_io", "//tensorflow/python/util:tf_decorator_py", @@ -45,5 +40,6 @@ py_strict_binary( "//tensorflow/tools/common:public_api", "//tensorflow/tools/common:traverse", "//tensorflow/tools/compatibility:tf_upgrade_v2_lib", + "@absl_py//absl:app", ], ) diff --git a/tensorflow/tools/compatibility/update/generate_v2_renames_map.py b/tensorflow/tools/compatibility/update/generate_v2_renames_map.py index 57d0441d015..b0c16c8af41 100644 --- a/tensorflow/tools/compatibility/update/generate_v2_renames_map.py +++ b/tensorflow/tools/compatibility/update/generate_v2_renames_map.py @@ -84,7 +84,6 @@ def get_all_v2_names(): visitor.do_not_descend_map['tf'].append('contrib') visitor.private_map['tf.compat'] = ['v1', 'v2'] traverse.traverse(tf.compat.v2, visitor) - traverse.traverse(tf.compat.v2.estimator, visitor) return v2_names @@ -161,9 +160,7 @@ def collect_function_renames(): visitor.private_map['tf.compat'] = ['v1', 'v2'] traverse.traverse(tf.version, visitor) traverse.traverse(tf.compat.v1, visitor) - traverse.traverse(tf.compat.v1.estimator, visitor) traverse.traverse(tf.compat.v2, visitor) - traverse.traverse(tf.compat.v2.estimator, visitor) return renames diff --git a/tensorflow/tools/compatibility/update/generate_v2_reorders_map.py b/tensorflow/tools/compatibility/update/generate_v2_reorders_map.py index 4180a96f860..05664ab36c9 100644 --- a/tensorflow/tools/compatibility/update/generate_v2_reorders_map.py +++ b/tensorflow/tools/compatibility/update/generate_v2_reorders_map.py @@ -96,9 +96,7 @@ def collect_function_arg_names(function_names, return_all_args_function_names, visitor.do_not_descend_map['tf'].append('contrib') visitor.private_map['tf.compat'] = ['v1', 'v2'] traverse.traverse(tf.compat.v1, visitor) - traverse.traverse(tf.compat.v1.estimator, visitor) traverse.traverse(tf.compat.v2, visitor) - traverse.traverse(tf.compat.v2.estimator, visitor) def get_arguments_list(attr): if tf_inspect.isclass(attr): diff --git a/tensorflow/tools/docs/BUILD b/tensorflow/tools/docs/BUILD index aa9490cf911..28a821e7dc8 100644 --- a/tensorflow/tools/docs/BUILD +++ b/tensorflow/tools/docs/BUILD @@ -1,14 +1,14 @@ # Description: # Doc generator -load("//tensorflow:py.default.bzl", "py_library") load("//tensorflow:strict.default.bzl", "py_strict_binary", "py_strict_library", "py_strict_test") +load("//tensorflow:py.default.bzl", "py_library") load("//tensorflow:tensorflow.default.bzl", "get_compatible_with_portable") -load("//tensorflow/python/tpu:tpu.bzl", "tpu_py_strict_test") load( "//tensorflow/core/platform:build_config_root.bzl", "tf_gpu_tests_tags", ) +load("//tensorflow/python/tpu:tpu.bzl", "tpu_py_strict_test") package( # copybara:uncomment default_applicable_licenses = ["//tensorflow:license"], @@ -175,7 +175,6 @@ py_strict_test( ], deps = [ ":generate2_lib", - # copybara:uncomment "//third_party/py/tensorflow:tensorflow_estimator", "//tensorflow:tensorflow_py", "//tensorflow/python/platform:test", "@pypi_packaging//:pkg", @@ -206,7 +205,6 @@ py_strict_library( srcs_version = "PY3", deps = [ ":base_dir_oss", - # copybara:uncomment "//third_party/py/tensorflow:tensorflow_estimator", "//tensorflow:tensorflow_py_no_contrib", "//tensorflow/python/framework:ops", "//tensorflow/python/util:pywrap_xla_ops", diff --git a/tensorflow/tools/docs/base_dir.py b/tensorflow/tools/docs/base_dir.py index a5f5ef65bcf..a210613f7b5 100644 --- a/tensorflow/tools/docs/base_dir.py +++ b/tensorflow/tools/docs/base_dir.py @@ -20,7 +20,6 @@ from packaging import version import tensorboard import tensorflow as tf from tensorflow_docs.api_generator import public_api -import tensorflow_estimator def get_base_dirs_and_prefixes(code_url_prefix): @@ -46,7 +45,6 @@ def get_base_dirs_and_prefixes(code_url_prefix): # The generated api-module files are now in `site-packages/keras/...` pathlib.Path(keras.__file__).parent, pathlib.Path(tensorboard.__file__).parent, - pathlib.Path(tensorflow_estimator.__file__).parent, # The tensorflow base dir goes last because `tf.keras`` base_dir, ] @@ -57,7 +55,6 @@ def get_base_dirs_and_prefixes(code_url_prefix): None, None, f"https://github.com/tensorflow/tensorboard/tree/{tensorboard.__version__}/tensorboard", - "https://github.com/tensorflow/estimator/tree/master/tensorflow_estimator", code_url_prefix, ) elif version.parse(tf.__version__) >= version.parse("2.9"): @@ -65,13 +62,11 @@ def get_base_dirs_and_prefixes(code_url_prefix): base_dir, pathlib.Path(keras.__file__).parent, pathlib.Path(tensorboard.__file__).parent, - pathlib.Path(tensorflow_estimator.__file__).parent, ] code_url_prefixes = ( code_url_prefix, keras_url_prefix, f"https://github.com/tensorflow/tensorboard/tree/{tensorboard.__version__}/tensorboard", - "https://github.com/tensorflow/estimator/tree/master/tensorflow_estimator", ) else: raise ValueError("Unsupported: version < 2.9") diff --git a/tensorflow/tools/docs/generate2.py b/tensorflow/tools/docs/generate2.py index f8faf94ac26..caac9f7bbce 100644 --- a/tensorflow/tools/docs/generate2.py +++ b/tensorflow/tools/docs/generate2.py @@ -207,7 +207,7 @@ class RawOpsPageInfo(module_page.ModulePageInfo): # So prefix the score tuples with -1 when this is the canonical name, +1 # otherwise. The generator chooses the name with the lowest score. class TfExportAwareVisitor(doc_generator_visitor.DocGeneratorVisitor): - """A `tf_export`, `keras_export` and `estimator_export` aware doc_visitor.""" + """A `tf_export`, and `keras_export` aware doc_visitor.""" class TfNameScore(NamedTuple): canonical_score: int @@ -216,8 +216,7 @@ class TfExportAwareVisitor(doc_generator_visitor.DocGeneratorVisitor): def _score_name(self, path: doc_generator_visitor.ApiPath) -> TfNameScore: name = ".".join(path) all_exports = [tf_export.TENSORFLOW_API_NAME, - tf_export.KERAS_API_NAME, - tf_export.ESTIMATOR_API_NAME] + tf_export.KERAS_API_NAME] for api_name in all_exports: try: @@ -248,7 +247,6 @@ def build_docs(output_dir, code_url_prefix, search_hints): if version.parse(tf.__version__) >= version.parse("2.9"): doc_controls.set_deprecated(tf.compat.v1) - doc_controls.set_deprecated(tf.estimator) doc_controls.set_deprecated(tf.feature_column) doc_controls.set_deprecated(tf.keras.preprocessing) diff --git a/tensorflow/tools/docs/generate2_test.py b/tensorflow/tools/docs/generate2_test.py index c0e7cce13e0..eb9cf106f50 100644 --- a/tensorflow/tools/docs/generate2_test.py +++ b/tensorflow/tools/docs/generate2_test.py @@ -22,7 +22,6 @@ from unittest import mock from packaging import version import tensorflow as tf -from tensorflow import estimator as tf_estimator import yaml from tensorflow.python.platform import googletest @@ -42,7 +41,6 @@ class AutoModule(types.ModuleType): # Make a mock tensorflow package that won't take too long to test. fake_tf = AutoModule('FakeTensorFlow') fake_tf.Module = tf.Module # pylint: disable=invalid-name -fake_tf.estimator.DNNClassifier = tf_estimator.DNNClassifier fake_tf.feature_column.nummeric_column = tf.feature_column.numeric_column fake_tf.keras.Model = tf.keras.Model fake_tf.keras.preprocessing = tf.keras.preprocessing diff --git a/tensorflow/tools/pip_package/setup.py b/tensorflow/tools/pip_package/setup.py index 9b0bd33cb4f..e6a52936a47 100644 --- a/tensorflow/tools/pip_package/setup.py +++ b/tensorflow/tools/pip_package/setup.py @@ -122,7 +122,6 @@ REQUIRED_PACKAGES = [ # or final). For example, 'keras-nightly ~= 2.14.0.dev' will be replaced by # 'keras >= 2.14.0rc0, < 2.15' on the release branch after the branch cut. 'tb-nightly ~= 2.16.0.a', - 'tf-estimator-nightly ~= 2.14.0.dev', 'keras-nightly ~= 3.0.0.dev', ] REQUIRED_PACKAGES = [p for p in REQUIRED_PACKAGES if p is not None] @@ -201,10 +200,6 @@ CONSOLE_SCRIPTS = [ # We exclude it anyway if building tf_nightly. standard_or_nightly('tensorboard = tensorboard.main:run_main', None), 'tf_upgrade_v2 = tensorflow.tools.compatibility.tf_upgrade_v2_main:main', - ( - 'estimator_ckpt_converter =' - ' tensorflow_estimator.python.estimator.tools.checkpoint_converter:main' - ), ] CONSOLE_SCRIPTS = [s for s in CONSOLE_SCRIPTS if s is not None] # pylint: enable=line-too-long diff --git a/tensorflow/tools/pip_package/v2/setup.py b/tensorflow/tools/pip_package/v2/setup.py index 3848677077c..cd5525963ea 100644 --- a/tensorflow/tools/pip_package/v2/setup.py +++ b/tensorflow/tools/pip_package/v2/setup.py @@ -115,7 +115,6 @@ REQUIRED_PACKAGES = [ # or final). For example, 'keras-nightly ~= 2.14.0.dev' will be replaced by # 'keras >= 2.14.0rc0, < 2.15' on the release branch after the branch cut. 'tb-nightly ~= 2.16.0.a', - 'tf-estimator-nightly ~= 2.14.0.dev', 'keras-nightly ~= 3.0.0.dev', ] REQUIRED_PACKAGES = [p for p in REQUIRED_PACKAGES if p is not None] @@ -194,10 +193,6 @@ CONSOLE_SCRIPTS = [ # We exclude it anyway if building tf_nightly. standard_or_nightly('tensorboard = tensorboard.main:run_main', None), 'tf_upgrade_v2 = tensorflow.tools.compatibility.tf_upgrade_v2_main:main', - ( - 'estimator_ckpt_converter =' - ' tensorflow_estimator.python.estimator.tools.checkpoint_converter:main' - ), ] CONSOLE_SCRIPTS = [s for s in CONSOLE_SCRIPTS if s is not None] # pylint: enable=line-too-long diff --git a/tensorflow/tools/tf_sig_build_dockerfiles/devel.requirements.txt b/tensorflow/tools/tf_sig_build_dockerfiles/devel.requirements.txt index 4a899fb3504..6e5bbbaa16e 100644 --- a/tensorflow/tools/tf_sig_build_dockerfiles/devel.requirements.txt +++ b/tensorflow/tools/tf_sig_build_dockerfiles/devel.requirements.txt @@ -26,7 +26,7 @@ setuptools >= 68.2.2 wrapt ~= 1.14.1 # We need to pin the gast dependency exactly gast == 0.4.0 -# Finally, install tensorboard and estimator and keras +# Finally, install tensorboard, and keras # Note that here we want the latest version that matches TF major.minor version # Note that we must use nightly here as these are used in nightly jobs # For release jobs, we will pin these on the release branch @@ -34,7 +34,6 @@ gast == 0.4.0 # be the latest version. keras-nightly ~= 2.14.0.dev tb-nightly ~= 2.13.0.a -tf-estimator-nightly ~= 2.14.0.dev # Test dependencies grpcio ~= 1.59.0 # Earliest version for Python 3.12 portpicker ~= 1.6.0 diff --git a/tensorflow/tools/tf_sig_build_dockerfiles/devel.usertools/wheel_verification.bats b/tensorflow/tools/tf_sig_build_dockerfiles/devel.usertools/wheel_verification.bats index 17b689dbedd..d791c4b93c5 100644 --- a/tensorflow/tools/tf_sig_build_dockerfiles/devel.usertools/wheel_verification.bats +++ b/tensorflow/tools/tf_sig_build_dockerfiles/devel.usertools/wheel_verification.bats @@ -72,9 +72,3 @@ teardown_file() { source /tf/venv/bin/activate python3 -c 'import sys; import tensorflow as tf; sys.exit(0 if "keras" in tf.keras.__name__ else 1)' } - -# Is this still useful? -@test "TensorFlow has Estimator" { - source /tf/venv/bin/activate - python3 -c 'import sys; import tensorflow as tf; sys.exit(0 if "_v2.estimator" in tf.estimator.__name__ else 1)' -} diff --git a/tensorflow/virtual_root_template_v1.__init__.py b/tensorflow/virtual_root_template_v1.__init__.py index cfebee3f835..32f5ae0a1d7 100644 --- a/tensorflow/virtual_root_template_v1.__init__.py +++ b/tensorflow/virtual_root_template_v1.__init__.py @@ -19,13 +19,15 @@ import sys as _sys import importlib as _importlib import types as _types +from tensorflow.python.util import module_wrapper + # Since TensorFlow Python code now resides in tensorflow_core but TensorFlow -# ecosystem code (e.g. estimator, but also even tensorflow) imports tensorflow -# we need to do forwarding between the two. To do so, we use a lazy loader to -# load and forward the top level modules. We cannot use the LazyLoader defined -# by tensorflow at tensorflow/python/util/lazy_loader.py as to use that we would -# already need to import tensorflow. Hence, we define it inline. +# ecosystem code imports tensorflow, we need to do forwarding between the two. +# To do so, we use a lazy loader to load and forward the top level modules. We +# cannot use the LazyLoader defined by tensorflow at +# tensorflow/python/util/lazy_loader.py as to use that we would already need to +# import tensorflow. Hence, we define it inline. class _LazyLoader(_types.ModuleType): """Lazily import a module so that we can forward it.""" @@ -78,16 +80,6 @@ _top_level_modules = [ "tensorflow.summary", # tensorboard "tensorflow.examples", ] -# Estimator needs to be handled separatedly so we can still allow both -# import tensorflow_estimator and import tensorflow.estimator work -# Only in the second case do we actually need to do forwarding, the first case -# already defines most of the hierarchy and eagerly forwarding would result in -# an import loop. -if "tensorflow_estimator" not in _sys.modules: - _root_estimator = False - _top_level_modules.append("tensorflow.estimator") -else: - _root_estimator = True # Lazy load all of the _top_level_modules, we don't need their names anymore for _m in _top_level_modules: @@ -99,9 +91,8 @@ from tensorflow_core import * _major_api_version = 1 # In V1 API we need to print deprecation messages -from tensorflow.python.util import deprecation_wrapper as _deprecation -if not isinstance(_sys.modules[__name__], _deprecation.DeprecationWrapper): - _sys.modules[__name__] = _deprecation.DeprecationWrapper( +if not isinstance(_sys.modules[__name__], module_wrapper.TFModuleWrapper): + _sys.modules[__name__] = module_wrapper.TFModuleWrapper( _sys.modules[__name__], "") # These should not be visible in the main tf module. diff --git a/tensorflow/virtual_root_template_v2.__init__.py b/tensorflow/virtual_root_template_v2.__init__.py index 60e41692bbf..b437019e685 100644 --- a/tensorflow/virtual_root_template_v2.__init__.py +++ b/tensorflow/virtual_root_template_v2.__init__.py @@ -21,11 +21,11 @@ import types as _types # Since TensorFlow Python code now resides in tensorflow_core but TensorFlow -# ecosystem code (e.g. estimator, but also even tensorflow) imports tensorflow -# we need to do forwarding between the two. To do so, we use a lazy loader to -# load and forward the top level modules. We cannot use the LazyLoader defined -# by tensorflow at tensorflow/python/util/lazy_loader.py as to use that we would -# already need to import tensorflow. Hence, we define it inline. +# ecosystem code imports tensorflow, we need to do forwarding between the two. +# To do so, we use a lazy loader to load and forward the top level modules. We +# cannot use the LazyLoader defined by tensorflow at +# tensorflow/python/util/lazy_loader.py as to use that we would already need to +# import tensorflow. Hence, we define it inline. class _LazyLoader(_types.ModuleType): """Lazily import a module so that we can forward it.""" @@ -78,16 +78,6 @@ _top_level_modules = [ "tensorflow.summary", # tensorboard "tensorflow.examples", ] -# Estimator needs to be handled separatedly so we can still allow both -# import tensorflow_estimator and import tensorflow.estimator work -# Only in the second case do we actually need to do forwarding, the first case -# already defines most of the hierarchy and eagerly forwarding would result in -# an import loop. -if "tensorflow_estimator" not in _sys.modules: - _root_estimator = False - _top_level_modules.append("tensorflow.estimator") -else: - _root_estimator = True # Lazy load all of the _top_level_modules, we don't need their names anymore for _m in _top_level_modules: