Esempio n. 1
0
 def test(self):
   expected_a = core.LabeledTensor(tf.constant([1, 5]), ['batch'])
   expected_b = core.LabeledTensor(tf.constant([[2, 3, 4], [6, 7, 8]]),
                                   ['batch', 'x'])
   parsed = io_ops.parse_example(self.serialized, self.features)
   self.assertLabeledTensorsEqual(expected_a, parsed['a'])
   self.assertLabeledTensorsEqual(expected_b, parsed['b'])
Esempio n. 2
0
 def test(self):
     expected_a = core.LabeledTensor(tf.constant([1, 5]), ['batch'])
     expected_b = core.LabeledTensor(tf.constant([[2, 3, 4], [6, 7, 8]]),
                                     ['batch', 'x'])
     parsed = io_ops.parse_example(self.serialized, self.features)
     self.assertLabeledTensorsEqual(expected_a, parsed['a'])
     self.assertLabeledTensorsEqual(expected_b, parsed['b'])
Esempio n. 3
0
 def test_placeholder(self):
   serialized = core.LabeledTensor(tf.placeholder(tf.string, [None]),
                                   ['batch'])
   # should not raise
   io_ops.parse_example(serialized, self.features)
Esempio n. 4
0
 def test_placeholder(self):
     serialized = core.LabeledTensor(
         array_ops.placeholder(dtypes.string, [None]), ['batch'])
     # should not raise
     io_ops.parse_example(serialized, self.features)