def test_unknown_size(self): features = {'a': io_ops.FixedLenFeature([('x', None)], tf.int64)} serialized = tf.placeholder(tf.string, []) with self.assertRaisesRegexp(ValueError, 'unknown size'): io_ops.parse_single_example(serialized, features)
def test_unknown_size(self): features = {'a': io_ops.FixedLenFeature([('x', None)], dtypes.int64)} serialized = array_ops.placeholder(dtypes.string, []) with self.assertRaisesRegexp(ValueError, 'unknown size'): io_ops.parse_single_example(serialized, features)
def test(self): expected_a = core.LabeledTensor(tf.constant(1), []) expected_b = core.LabeledTensor(tf.constant([2, 3, 4]), ['x']) parsed = io_ops.parse_single_example(self.serialized[0], self.features) self.assertLabeledTensorsEqual(expected_a, parsed['a']) self.assertLabeledTensorsEqual(expected_b, parsed['b'])
def test(self): expected_a = core.LabeledTensor(constant_op.constant(1), []) expected_b = core.LabeledTensor(constant_op.constant([2, 3, 4]), ['x']) parsed = io_ops.parse_single_example(self.serialized[0], self.features) self.assertLabeledTensorsEqual(expected_a, parsed['a']) self.assertLabeledTensorsEqual(expected_b, parsed['b'])