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
This commit is contained in:
parent
be15e9eb12
commit
f2bbf4b9e7
tensorflow
@ -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",
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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__",
|
||||
],
|
||||
)
|
||||
|
@ -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",
|
||||
],
|
||||
)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user