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'])
def test_placeholder(self): serialized = core.LabeledTensor(tf.placeholder(tf.string, [None]), ['batch']) # should not raise io_ops.parse_example(serialized, self.features)
def test_placeholder(self): serialized = core.LabeledTensor( array_ops.placeholder(dtypes.string, [None]), ['batch']) # should not raise io_ops.parse_example(serialized, self.features)