Base decoder object.
Instead of subclassing, you can also create a
Decoder from a function with the
All decoders must derive from this base class. The implementation can access the
self.feature property which will correspond to the
FeatureConnector to which
this decoder is applied.
To implement a decoder, the main method to override is
takes the serialized feature as input and returns the decoded feature.
decode_example changes the output dtype, you must also override the
property. This enables compatibility with
dtype after decoding.
Decode the example feature field (eg: image).
tf.Tensoras decoded, the dtype/shape should be identical to
example: Decoded example.
The initialization of decode object is deferred because the objects only know the builder/features on which it is used after it has been constructed, the initialization is done in this function.
tfds.features.FeatureConnector, the feature to which is applied this transformation.