diff options
author | 2017-05-11 11:56:51 -0700 | |
---|---|---|
committer | 2017-05-11 12:01:19 -0700 | |
commit | f2bbf4b9e7d2559ea9667ec791843a19f0f776fc (patch) | |
tree | 611ff30ce13f447fae0bd5d03a10df020098cb2f | |
parent | be15e9eb12a2c61f9b0fef98e94967e64af1f6a1 (diff) |
Move back lookup_ops from feature_column/ to contrib/lookup/ since they are using V1 kernels and we want core use the V2 kernels.
PiperOrigin-RevId: 155777403
-rw-r--r-- | tensorflow/contrib/lookup/BUILD | 12 | ||||
-rw-r--r-- | tensorflow/contrib/lookup/__init__.py | 2 | ||||
-rw-r--r-- | tensorflow/contrib/lookup/lookup_ops.py (renamed from tensorflow/python/feature_column/lookup_ops.py) | 0 | ||||
-rw-r--r-- | tensorflow/python/BUILD | 3 | ||||
-rw-r--r-- | tensorflow/python/feature_column/BUILD | 23 | ||||
-rw-r--r-- | tensorflow/python/feature_column/feature_column.py | 4 |
6 files changed, 16 insertions, 28 deletions
diff --git a/tensorflow/contrib/lookup/BUILD b/tensorflow/contrib/lookup/BUILD index bbbd340352..b0475c41c9 100644 --- a/tensorflow/contrib/lookup/BUILD +++ b/tensorflow/contrib/lookup/BUILD @@ -9,14 +9,24 @@ package(default_visibility = ["//tensorflow:internal"]) load("//tensorflow:tensorflow.bzl", "py_test") +# TODO(yleon): Refactor after one we switching to the V2 kernels. py_library( name = "lookup_py", srcs = [ "__init__.py", + "lookup_ops.py", ], srcs_version = "PY2AND3", deps = [ - "//tensorflow/python/feature_column:lookup_ops", + "//tensorflow/python:array_ops", + "//tensorflow/python:control_flow_ops", + "//tensorflow/python:framework", + "//tensorflow/python:framework_for_generated_wrappers", + "//tensorflow/python:lookup_ops_gen", + "//tensorflow/python:math_ops", + "//tensorflow/python:string_ops", + "//tensorflow/python:training", + "//tensorflow/python:util", ], ) diff --git a/tensorflow/contrib/lookup/__init__.py b/tensorflow/contrib/lookup/__init__.py index a5fcdc7b42..dbd64cf042 100644 --- a/tensorflow/contrib/lookup/__init__.py +++ b/tensorflow/contrib/lookup/__init__.py @@ -47,7 +47,7 @@ from __future__ import division from __future__ import print_function # pylint: disable=unused-import,wildcard-import -from tensorflow.python.feature_column.lookup_ops import * +from tensorflow.contrib.lookup.lookup_ops import * # pylint: enable=unused-import,wildcard-import from tensorflow.python.util.all_util import remove_undocumented diff --git a/tensorflow/python/feature_column/lookup_ops.py b/tensorflow/contrib/lookup/lookup_ops.py index b415235b99..b415235b99 100644 --- a/tensorflow/python/feature_column/lookup_ops.py +++ b/tensorflow/contrib/lookup/lookup_ops.py diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD index e9f7a68045..feab1e2fbc 100644 --- a/tensorflow/python/BUILD +++ b/tensorflow/python/BUILD @@ -82,7 +82,6 @@ py_library( "//third_party/py/numpy", "//tensorflow/python/estimator:estimator_py", "//tensorflow/python/feature_column:feature_column", - "//tensorflow/python/feature_column:lookup_ops", "//tensorflow/python/ops/losses", "//tensorflow/python/ops/distributions", "//tensorflow/python/saved_model", @@ -1061,7 +1060,7 @@ tf_gen_op_wrapper_private_py( require_shape_functions = True, visibility = [ "//learning/brain/python/ops:__pkg__", - "//tensorflow/python/feature_column:__pkg__", + "//tensorflow/contrib/lookup:__pkg__", "//tensorflow/python/kernel_tests:__pkg__", ], ) diff --git a/tensorflow/python/feature_column/BUILD b/tensorflow/python/feature_column/BUILD index 8e26465f26..1b1790d280 100644 --- a/tensorflow/python/feature_column/BUILD +++ b/tensorflow/python/feature_column/BUILD @@ -29,10 +29,10 @@ py_library( srcs = ["feature_column.py"], srcs_version = "PY2AND3", deps = [ - ":lookup_ops", "//tensorflow/python:embedding_ops", "//tensorflow/python:framework", "//tensorflow/python:init_ops", + "//tensorflow/python:lookup_ops", "//tensorflow/python:math_ops", "//tensorflow/python:parsing_ops", "//tensorflow/python:platform", @@ -72,24 +72,3 @@ py_test( "//tensorflow/python:training", ], ) - -# TODO(ptucker,yleon): Move along with 3p/tf/contrib/lookup. -# Test is still in 3p/tf/contrib/lookup. -py_library( - name = "lookup_ops", - srcs = [ - "lookup_ops.py", - ], - srcs_version = "PY2AND3", - deps = [ - "//tensorflow/python:array_ops", - "//tensorflow/python:control_flow_ops", - "//tensorflow/python:framework", - "//tensorflow/python:framework_for_generated_wrappers", - "//tensorflow/python:lookup_ops_gen", - "//tensorflow/python:math_ops", - "//tensorflow/python:string_ops", - "//tensorflow/python:training", - "//tensorflow/python:util", - ], -) diff --git a/tensorflow/python/feature_column/feature_column.py b/tensorflow/python/feature_column/feature_column.py index 391f3123ac..c9baef0695 100644 --- a/tensorflow/python/feature_column/feature_column.py +++ b/tensorflow/python/feature_column/feature_column.py @@ -128,7 +128,6 @@ import math import numpy as np import six -from tensorflow.python.feature_column import lookup_ops from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import sparse_tensor as sparse_tensor_lib @@ -137,6 +136,7 @@ from tensorflow.python.ops import array_ops from tensorflow.python.ops import check_ops from tensorflow.python.ops import embedding_ops from tensorflow.python.ops import init_ops +from tensorflow.python.ops import lookup_ops from tensorflow.python.ops import math_ops from tensorflow.python.ops import nn_ops from tensorflow.python.ops import parsing_ops @@ -1950,7 +1950,7 @@ class _VocabularyListCategoricalColumn( input_tensor = math_ops.to_int64(input_tensor) return lookup_ops.index_table_from_tensor( - mapping=tuple(self.vocabulary_list), + vocabulary_list=tuple(self.vocabulary_list), default_value=self.default_value, dtype=key_dtype, name='{}_lookup'.format(self.key)).lookup(input_tensor) |