Remove some unused methods.
PiperOrigin-RevId: 312617087 Change-Id: I60618ee25984825997c204740c12eddefbf9d398
This commit is contained in:
parent
203c1de5a4
commit
ed0eb69b76
@ -309,18 +309,8 @@ class TextVectorization(CombinerPreprocessingLayer):
|
||||
def _get_vectorization_class(self):
|
||||
return categorical_encoding.CategoricalEncoding
|
||||
|
||||
def _get_table_data(self):
|
||||
keys, values = self._table.export()
|
||||
return (keys.numpy(), values.numpy())
|
||||
|
||||
def _get_index_lookup_class(self):
|
||||
return string_lookup.StringLookup
|
||||
|
||||
def _to_numpy(self, preprocessed_data):
|
||||
"""Converts preprocessed inputs into numpy arrays."""
|
||||
if isinstance(preprocessed_data, np.ndarray):
|
||||
return preprocessed_data
|
||||
return np.array(preprocessed_data.to_list())
|
||||
# End of V1/V2 shim points.
|
||||
|
||||
def _assert_same_type(self, expected_type, values, value_name):
|
||||
|
@ -18,14 +18,10 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
|
||||
from tensorflow.python.keras import backend as K
|
||||
from tensorflow.python.keras.engine import base_preprocessing_layer_v1
|
||||
from tensorflow.python.keras.layers.preprocessing import categorical_encoding_v1
|
||||
from tensorflow.python.keras.layers.preprocessing import string_lookup_v1
|
||||
from tensorflow.python.keras.layers.preprocessing import text_vectorization
|
||||
from tensorflow.python.ops.ragged import ragged_tensor_value
|
||||
from tensorflow.python.util.tf_export import keras_export
|
||||
|
||||
|
||||
@ -85,13 +81,3 @@ class TextVectorization(text_vectorization.TextVectorization,
|
||||
|
||||
def _get_index_lookup_class(self):
|
||||
return string_lookup_v1.StringLookup
|
||||
|
||||
def _to_numpy(self, data):
|
||||
"""Converts preprocessed inputs into numpy arrays."""
|
||||
if isinstance(data, np.ndarray):
|
||||
return data
|
||||
session = K.get_session()
|
||||
data = session.run(data)
|
||||
if isinstance(data, ragged_tensor_value.RaggedTensorValue):
|
||||
data = np.array(data.to_list())
|
||||
return data
|
||||
|
Loading…
x
Reference in New Issue
Block a user