tf.io.parse_single_example

tf.io.parse_single_example 与 tf.io.parse_example像类似

一: 语法:

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

二、参数:

Args:
  • serialized: A scalar string Tensor, a single serialized Example.
  • features: A dict mapping feature keys to FixedLenFeature or VarLenFeature values.
  • example_names: (Optional) A scalar string Tensor, the associated name.
  • name: A name for this operation (optional).
Returns:
  • A dict mapping feature keys to Tensor and SparseTensor values.

三、与tf.io.parse_example的不同

Similar to parse_example, except:

For dense tensors, the returned Tensor is identical to the output of parse_example, except there is no batch dimension, the output shape is the same as the shape given in dense_shape.

For SparseTensors, the first (batch) column of the indices matrix is removed (the indices matrix is a column vector), the values vector is unchanged, and the first (batch_size) entry of the shape vector is removed (it is now a single element vector).

One might see performance advantages by batching Example protos with parse_example instead of using this function directly.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值