TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tft.coders.ExampleProtoCoder

Class ExampleProtoCoder

A coder between maybe-serialized TF Examples and tf.Transform datasets.

__init__

__init__(
    schema,
    serialized=True
)

Build an ExampleProtoCoder.

Args:

  • schema: A Schema proto.
  • serialized: Whether to encode / decode serialized Example protos (as opposed to in-memory Example protos). The default (True) is used for backwards compatibility. Note that the serialized=True option might be removed in a future version.

Raises:

  • ValueError: If schema is invalid.

Methods

decode

decode(example_proto)

Decode tf.Example as a tf.transform encoded dict.

encode

encode(instance)

Encode a tf.transform encoded dict as tf.Example.