<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#L174-L213) |

Decorator to create a decoder.

    tfds.decode.make_decoder(
        output_dtype=None
    )

The decorated function should have the signature `(example, feature, *args,
**kwargs) -> decoded_example`.

- `example`: Serialized example before decoding
- `feature`: `FeatureConnector` associated with the example
- `*args, **kwargs`: Optional additional kwargs forwarded to the function

#### Example:

    @tfds.decode.make_decoder(output_dtype=tf.string)
    def no_op_decoder(example, feature):
      """Decoder simply decoding feature normally."""
      return feature.decode_example(example)

    tfds.load('mnist', split='train', decoders: {
        'image': no_op_decoder(),
    })

<br />

<br />

<br />

| ## Args ||
|---|---|
| `output_dtype` | The output dtype after decoding. Required only if the decoded example has a different type than the [`FeatureConnector.dtype`](https://www.tensorflow.org/datasets/api_docs/python/tfds/features/FeatureConnector#dtype) and is used to decode features inside sequences (ex: videos) |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The decoder object ||

<br />