Deep learning和tensorflow学习记录(九): tf.parse_single_example

tf.parse_single_example(
    serialized,
    features,
    name=None,
    example_names=None

)

定义于:tensorflow/python/ops/parsing_ops.py。

解析一个Example原型。

类似于parse_example,除了:

对于稠密型Tensor,返回的Tensor与parse_example的输出相同。除了没有batch的维度,输出的形状与dense_shape中给定的形状相同。

对于稀疏型Tensor,删除了索引矩阵的第一(batch)列,值向量不变,并且形状向量的第一(batch_size)条目被删除(它现在是单个元素向量)。

人们可能会通过使用parse_example批处理Example原型而不是直接使用此函数来获取性能上的优势。

参数:

serialized:标量字符串Tensor,单个序列化Example。

features:字典映射到FixedLenFeature或者VarLenFeature的值。

扫描二维码关注公众号,回复: 1990684 查看本文章

name:此操作的名称(可选)。

example_names:(可选)标量字符串Tensor,关联名称。

返回:

字典映射特征键值对到Tensor或者SparseTensor。


猜你喜欢

转载自blog.csdn.net/heiheiya/article/details/80966855