# tensorflow::ops::ParseSingleExample Class Reference

# tensorflow::
ops::
ParseSingleExample

`
#include <parsing_ops.h>
`


Transforms a tf.Example proto (as a string) into typed tensors.

## Summary


Args:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- serialized: A vector containing a batch of binary serialized Example protos.
- dense_defaults: A list of Tensors (some may be empty), whose length matches the length of `
  dense_keys
  ` . dense_defaults\[j\] provides default values when the example's feature_map lacks dense_key\[j\]. If an empty [Tensor](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) is provided for dense_defaults\[j\], then the Feature dense_keys\[j\] is required. The input type is inferred from dense_defaults\[j\], even when it's empty. If dense_defaults\[j\] is not empty, and dense_shapes\[j\] is fully defined, then the shape of dense_defaults\[j\] must match that of dense_shapes\[j\]. If dense_shapes\[j\] has an undefined major dimension (variable strides dense feature), dense_defaults\[j\] must contain a single element: the padding element.
- num_sparse: The number of sparse features to be parsed from the example. This must match the lengths of `
  sparse_keys
  ` and `
  sparse_types
  ` .
- sparse_keys: A list of `
  num_sparse
  ` strings. The keys expected in the Examples' features associated with sparse values.
- dense_keys: The keys expected in the Examples' features associated with dense values.
- sparse_types: A list of `
  num_sparse
  ` types; the data types of data in each Feature given in sparse_keys. Currently the [ParseSingleExample](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/parse-single-example#classtensorflow_1_1ops_1_1_parse_single_example) op supports DT_FLOAT (FloatList), DT_INT64 (Int64List), and DT_STRING (BytesList).
- dense_shapes: The shapes of data in each Feature given in dense_keys. The length of this list must match the length of `
  dense_keys
  ` . The number of elements in the Feature corresponding to dense_key\[j\] must always equal dense_shapes\[j\].NumEntries(). If dense_shapes\[j\] == (D0, D1, ..., DN) then the shape of output [Tensor](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) dense_values\[j\] will be (D0, D1, ..., DN): In the case dense_shapes\[j\] = (-1, D1, ..., DN), the shape of the output [Tensor](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) dense_values\[j\] will be (M, D1, .., DN), where M is the number of blocks of elements of length D1 \* .... \* DN, in the input.

<br />


Returns:

- `
  OutputList
  ` sparse_indices
- `
  OutputList
  ` sparse_values
- `
  OutputList
  ` sparse_shapes
- `
  OutputList
  ` dense_values

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/parse-single-example#classtensorflow_1_1ops_1_1_parse_single_example_1a2907d81d498acfa5ffbe97b70859a6ac (const :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input serialized, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list dense_defaults, int64 num_sparse, const gtl::ArraySlice<::tensorflow::tstring > & sparse_keys, const gtl::ArraySlice<::tensorflow::tstring > & dense_keys, const DataTypeSlice & sparse_types, const gtl::ArraySlice< PartialTensorShape > & dense_shapes) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/parse-single-example#classtensorflow_1_1ops_1_1_parse_single_example_1a47aea5050a1c195f45e106a7e5dd8d6c ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/parse-single-example#classtensorflow_1_1ops_1_1_parse_single_example_1a653e666e79f4a510ce99022030457306 ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/parse-single-example#classtensorflow_1_1ops_1_1_parse_single_example_1aff26528d71218f864c4bbe158da75497 ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/parse-single-example#classtensorflow_1_1ops_1_1_parse_single_example_1a43c18746bd9c93c475b6f796e90cf197 ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/parse-single-example#classtensorflow_1_1ops_1_1_parse_single_example_1a0dbd7fd1ac19943db8a06f1004a43731 ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c ` |

## Public attributes

### dense_values

```
::tensorflow::OutputList dense_values
```

### operation

```
Operation operation
```

### sparse_indices

```
::tensorflow::OutputList sparse_indices
```

### sparse_shapes

```
::tensorflow::OutputList sparse_shapes
```

### sparse_values

```
::tensorflow::OutputList sparse_values
```

## Public functions

### ParseSingleExample

```
 ParseSingleExample(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input serialized,
  ::tensorflow::InputList dense_defaults,
  int64 num_sparse,
  const gtl::ArraySlice<::tensorflow::tstring > & sparse_keys,
  const gtl::ArraySlice<::tensorflow::tstring > & dense_keys,
  const DataTypeSlice & sparse_types,
  const gtl::ArraySlice< PartialTensorShape > & dense_shapes
)
```