data_pipeline.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:hdrnet_legacy 作者: mgharbi 项目源码 文件源码
def _parse_example(self, serialized):
    """Unpack a serialized example to Tensor."""
    feats = self._get_data_features()
    sz_feats = self._get_sz_features()
    for s in sz_feats:
      feats[s] = sz_feats[s]
    sample = tf.parse_single_example(serialized, features=feats)

    data = {}
    for i, f in enumerate(self.FEATURES):
      s = tf.to_int32(sample[f+'_sz'])

      data[f] = tf.decode_raw(sample[f], self.dtypes[f], name='decode_{}'.format(f))
      data[f] = tf.reshape(data[f], s)

    return data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号