<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/decode/base.py#L216-L240) |

How to deserialize the bytes that are read before returning.

When reading examples from a source (e.g., a file), we consider 2 phases in
parsing the raw data:

1. Deserialize: deserializes raw bytes into an object. Typically it will be
   deserialized into a [`tf.train.Example`](https://www.tensorflow.org/api_docs/python/tf/train/Example).

2. Decode: A [`tf.train.Example`](https://www.tensorflow.org/api_docs/python/tf/train/Example) might encode information (e.g., a bytes
   feature encodes an image or a int64 list encodes a tensor). The second
   phase decodes the encoded information.

DESERIALIZE_AND_DECODE: deserialize the raw bytes to tf example (if file
format doesn't have a custom encoding) and then decode the features. Note
that how and what is decoded can typically be overriden with `decoders`.
DESERIALIZE_NO_DECODE: parse the raw bytes to tf example (if file format
doesn't have a custom encoding). If this parse method is used, then all
decoders are ignored.
RAW_BYTES: don't parse nor decode, but return the raw bytes.

<br />

<br />

<br />

| ## Class Variables ||
|---|---|
| DESERIALIZE_AND_DECODE | `<DeserializeMethod.DESERIALIZE_AND_DECODE: 'deserialize_and_decode'>` |
| DESERIALIZE_NO_DECODE | `<DeserializeMethod.DESERIALIZE_NO_DECODE: 'deserialize_no_decode'>` |
| RAW_BYTES | `<DeserializeMethod.RAW_BYTES: 'raw_bytes'>` |

<br />