def from_feature_spec(feature_spec):
"""Convert a feature_spec to a Schema.
Args:
feature_spec: a features specification in the format expected by
tf.parse_example(), i.e.
`{name: FixedLenFeature(...), name: VarLenFeature(...), ...'
Returns:
A Schema representing the provided set of columns.
"""
return Schema({
key: _from_parse_feature(parse_feature)
for key, parse_feature in six.iteritems(feature_spec)
})
评论列表
文章目录