# tf.io.parse_single_example

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/io/parse_single_example) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.0.0/tensorflow/python/ops/parsing_ops.py#L1025-L1072) |

Parses a single `Example` proto.

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

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 `SparseTensor`s, 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.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `serialized` | A scalar string Tensor, a single serialized Example. See `_parse_single_example_raw` documentation for more details. |
| `features` | A `dict` mapping feature keys to `FixedLenFeature` or `VarLenFeature` values. |
| `example_names` | (Optional) A scalar string Tensor, the associated name. See `_parse_single_example_raw` documentation for more details. |
| `name` | A name for this operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `dict` mapping feature keys to `Tensor` and `SparseTensor` values. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | if any feature is invalid. |

<br />