aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/util/example_parser_configuration_test.py
diff options
context:
space:
mode:
authorGravatar Justine Tunney <jart@google.com>2016-12-16 18:16:15 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-12-16 18:26:25 -0800
commit58201a058853de647b37ddb0ccf63d89b2357f03 (patch)
treea70f1626ef6c6bae985c3b581e2a6f9ce6f6b96e /tensorflow/python/util/example_parser_configuration_test.py
parent157dbdda6d7d6e4f679c5e89d0bd3e8c0a6085d5 (diff)
Remove hourglass imports from even more tests
Change: 142318245
Diffstat (limited to 'tensorflow/python/util/example_parser_configuration_test.py')
-rw-r--r--tensorflow/python/util/example_parser_configuration_test.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/tensorflow/python/util/example_parser_configuration_test.py b/tensorflow/python/util/example_parser_configuration_test.py
index 7bfb1cb271..e28f774d47 100644
--- a/tensorflow/python/util/example_parser_configuration_test.py
+++ b/tensorflow/python/util/example_parser_configuration_test.py
@@ -13,14 +13,19 @@
# limitations under the License.
# ==============================================================================
"""Tests for ExampleParserConfiguration."""
+
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
-import tensorflow as tf
-
from google.protobuf import text_format
+
from tensorflow.core.example import example_parser_configuration_pb2
+from tensorflow.python.client import session
+from tensorflow.python.framework import dtypes
+from tensorflow.python.ops import array_ops
+from tensorflow.python.ops import parsing_ops
+from tensorflow.python.platform import test
from tensorflow.python.util.example_parser_configuration import extract_example_parser_configuration
BASIC_PROTO = """
@@ -61,19 +66,19 @@ feature_map {
"""
-class ExampleParserConfigurationTest(tf.test.TestCase):
+class ExampleParserConfigurationTest(test.TestCase):
def testBasic(self):
golden_config = example_parser_configuration_pb2.ExampleParserConfiguration(
)
text_format.Parse(BASIC_PROTO, golden_config)
- with tf.Session() as sess:
- examples = tf.placeholder(tf.string, shape=[1])
+ with session.Session() as sess:
+ examples = array_ops.placeholder(dtypes.string, shape=[1])
feature_to_type = {
- 'x': tf.FixedLenFeature([1], tf.float32, 33.0),
- 'y': tf.VarLenFeature(tf.string)
+ 'x': parsing_ops.FixedLenFeature([1], dtypes.float32, 33.0),
+ 'y': parsing_ops.VarLenFeature(dtypes.string)
}
- _ = tf.parse_example(examples, feature_to_type)
+ _ = parsing_ops.parse_example(examples, feature_to_type)
parse_example_op = sess.graph.get_operation_by_name(
'ParseExample/ParseExample')
config = extract_example_parser_configuration(parse_example_op, sess)
@@ -81,4 +86,4 @@ class ExampleParserConfigurationTest(tf.test.TestCase):
if __name__ == '__main__':
- tf.test.main()
+ test.main()