codecamp

TensorFlow函数教程:tf.io.parse_single_example

tf.io.parse_single_example函数

别名:

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

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

解析一个Example原型。

类似于parse_example,但以下情况除外:

对于密集张量,返回的Tensor与parse_example的输出相同,除了没有批处理维度,输出shape与dense_shape中给出的shape相同。

对于SparseTensors,删除索引矩阵的第一个(批处理)列(索引矩阵是列向量),值向量不变,并且shape向量的第一个(batch_size)条目被删除(它现在是单个元素向量)。

人们可能会通过用parse-example对Example原型进行批处理,可以看到性能优势,而不是直接使用此函数来看到性能优势。

参数:

  • serialized:标量字符串Tensor,单个序列化Example。
  • features:dict映射功能键到FixedLenFeature或VarLenFeature值。
  • name:此操作的名称(可选)。
  • example_names:(可选)标量字符串Tensor,关联名称。

返回:

一个dict映射功能键到Tensor和SparseTensor值。

可能引发的异常:

  • ValueError:如果任何功能无效。
TensorFlow函数教程:tf.io.parse_sequence_example
TensorFlow函数教程:tf.io.parse_single_sequence_example
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }