Remove estimator_lib and import dependencies directly within estimator/__init__.py

PiperOrigin-RevId: 219198288
This commit is contained in:
A. Unique TensorFlower 2018-10-29 14:53:40 -07:00 committed by TensorFlower Gardener
parent 20e7d7db87
commit fbd12e7e7b
18 changed files with 19 additions and 56 deletions

View File

@ -25,9 +25,9 @@ from __future__ import print_function
import os
from tensorflow.contrib.lite.python import convert_saved_model
from tensorflow.python import estimator
from tensorflow.python import keras
from tensorflow.python.client import session
from tensorflow.python.estimator import estimator_lib as estimator
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape

View File

@ -20,7 +20,7 @@ from __future__ import print_function
from tensorflow.contrib.timeseries.examples import lstm
from tensorflow.python.estimator import estimator_lib
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.platform import test

View File

@ -26,7 +26,7 @@ from tensorflow.contrib.timeseries.python.timeseries import model_utils
from tensorflow.contrib.timeseries.python.timeseries.feature_keys import PredictionFeatures
from tensorflow.contrib.timeseries.python.timeseries.feature_keys import TrainEvalFeatures
from tensorflow.python.estimator import estimator_lib
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops

View File

@ -29,8 +29,8 @@ from tensorflow.contrib.timeseries.python.timeseries.estimators import ARRegress
from tensorflow.contrib.timeseries.python.timeseries.feature_keys import PredictionFeatures
from tensorflow.contrib.timeseries.python.timeseries.feature_keys import TrainEvalFeatures
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.client import session
from tensorflow.python.estimator import estimator_lib
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import variable_scope

View File

@ -29,7 +29,7 @@ from tensorflow.contrib.timeseries.python.timeseries.state_space_models import s
from tensorflow.contrib.timeseries.python.timeseries.state_space_models import structural_ensemble
from tensorflow.contrib.timeseries.python.timeseries.state_space_models.filtering_postprocessor import StateInterpolatingAnomalyDetector
from tensorflow.python.estimator import estimator_lib
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.estimator.canned import optimizers
from tensorflow.python.estimator.export import export_lib
from tensorflow.python.feature_column import feature_column

View File

@ -28,8 +28,8 @@ from tensorflow.contrib.timeseries.python.timeseries import feature_keys
from tensorflow.contrib.timeseries.python.timeseries import input_pipeline
from tensorflow.contrib.timeseries.python.timeseries import saved_model_utils
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.client import session
from tensorflow.python.estimator import estimator_lib
from tensorflow.python.feature_column import feature_column
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops

View File

@ -20,7 +20,7 @@ from __future__ import print_function
import re
from tensorflow.contrib.timeseries.python.timeseries import feature_keys
from tensorflow.python.estimator import estimator_lib
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.estimator.canned import head as head_lib
from tensorflow.python.estimator.canned import metric_keys
from tensorflow.python.estimator.export import export_lib

View File

@ -36,8 +36,8 @@ from tensorflow.contrib.timeseries.python.timeseries import model
from tensorflow.contrib.timeseries.python.timeseries import state_management
from tensorflow.core.example import example_pb2
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.client import session as session_lib
from tensorflow.python.estimator import estimator_lib
from tensorflow.python.feature_column import feature_column
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops

View File

@ -78,7 +78,7 @@ import numpy
from tensorflow.contrib.timeseries.python.timeseries import feature_keys
from tensorflow.contrib.timeseries.python.timeseries import model_utils
from tensorflow.python.estimator import estimator_lib
from tensorflow.python.estimator.inputs import numpy_io
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
@ -256,7 +256,7 @@ class NumpyReader(TimeSeriesReader):
# Remove the batch dimension from all features
features = {key: numpy.squeeze(value, axis=0)
for key, value in self._features.items()}
return estimator_lib.inputs.numpy_input_fn(
return numpy_io.numpy_input_fn(
x=features,
# The first dimensions of features are the series length, since we have
# removed the batch dimension above. We now pull out
@ -268,7 +268,7 @@ class NumpyReader(TimeSeriesReader):
def read_full(self):
"""Returns `Tensor` versions of the full Numpy arrays."""
features = estimator_lib.inputs.numpy_input_fn(
features = numpy_io.numpy_input_fn(
x=self._features,
batch_size=1,
num_epochs=None,

View File

@ -24,7 +24,7 @@ from tensorflow.contrib.timeseries.python.timeseries import feature_keys
from tensorflow.contrib.timeseries.python.timeseries import math_utils
from tensorflow.contrib.timeseries.python.timeseries.model import ModelOutputs
from tensorflow.python.estimator import estimator_lib
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops

View File

@ -27,7 +27,7 @@ from tensorflow.contrib.timeseries.python.timeseries import model
from tensorflow.contrib.timeseries.python.timeseries import state_management
from tensorflow.contrib.timeseries.python.timeseries import test_utils
from tensorflow.python.estimator import estimator_lib
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops

View File

@ -31,7 +31,7 @@ from tensorflow.contrib.timeseries.python.timeseries import model_utils
from tensorflow.contrib.timeseries.python.timeseries.feature_keys import TrainEvalFeatures
from tensorflow.contrib.timeseries.python.timeseries.state_space_models import kalman_filter
from tensorflow.python.estimator import estimator_lib
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops

View File

@ -33,7 +33,7 @@ from tensorflow.contrib.timeseries.python.timeseries import state_management
from tensorflow.contrib.timeseries.python.timeseries import test_utils
from tensorflow.contrib.timeseries.python.timeseries.state_space_models import state_space_model
from tensorflow.python.estimator import estimator_lib
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops

View File

@ -29,7 +29,7 @@ from tensorflow.contrib.timeseries.python.timeseries.feature_keys import TrainEv
from tensorflow.contrib.timeseries.python.timeseries.state_space_models import state_space_model
from tensorflow.contrib.timeseries.python.timeseries.state_space_models import structural_ensemble
from tensorflow.python.estimator import estimator_lib
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.framework import dtypes
from tensorflow.python.platform import test

View File

@ -25,7 +25,7 @@ from tensorflow.contrib.timeseries.python.timeseries.feature_keys import TrainEv
from tensorflow.contrib.timeseries.python.timeseries.state_space_models import state_space_model
from tensorflow.contrib.timeseries.python.timeseries.state_space_models import varma
from tensorflow.python.estimator import estimator_lib
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.framework import constant_op
from tensorflow.python.ops import variable_scope
from tensorflow.python.ops import variables

View File

@ -23,8 +23,8 @@ from tensorflow.contrib.timeseries.python.timeseries import input_pipeline
from tensorflow.contrib.timeseries.python.timeseries import state_management
from tensorflow.contrib.timeseries.python.timeseries.feature_keys import TrainEvalFeatures
from tensorflow.python import estimator as estimator_lib
from tensorflow.python.client import session
from tensorflow.python.estimator import estimator_lib
from tensorflow.python.framework import ops
from tensorflow.python.framework import random_seed
from tensorflow.python.ops import array_ops

View File

@ -4,10 +4,7 @@ licenses(["notice"]) # Apache 2.0
py_library(
name = "estimator_py",
srcs = [
"__init__.py",
"estimator_lib.py",
],
srcs = ["__init__.py"],
srcs_version = "PY2AND3",
visibility = [
"//tensorflow:__pkg__",

View File

@ -1,34 +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 __future__ import absolute_import
from __future__ import division
from __future__ import print_function
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 *