def test_feature_spec_unsupported_dtype(self):
schema = sch.Schema()
schema.column_schemas['fixed_float_with_default'] = (
sch.ColumnSchema(tf.float64, [1], sch.FixedColumnRepresentation(0.0)))
with self.assertRaisesRegexp(ValueError,
'tf.Example parser supports only types '
r'\[tf.string, tf.int64, tf.float32, tf.bool\]'
', so it is invalid to generate a feature_spec'
' with type tf.float64.'):
schema.as_feature_spec()
评论列表
文章目录