class_docstr: A coder between maybe-serialized TF Examples and tf.Transform datasets.
class_docstr_tok: ["A","coder","between","maybe-serialized","TF","Examples","and","tf.Transform","datasets","."]
docstr: Encode a tf.transform encoded dict as tf.Example.
docstr_tok: ["Encode","a","tf.transform","encoded","dict","as","tf.Example","."]
code: def encode(self, instance):
      """Encode a tf.transform encoded dict as tf.Example."""
      # The feature handles encode using the self._encode_example_cache.
      for feature_handler in self._feature_handlers:
          value = instance[feature_handler.name]
          try:
              feature_handler.encode_value(value)
          except TypeError as e:
              raise TypeError(
                  '%s while encoding feature "%s"'
                  % (e, feature_handler.name)
              )
  
      if self._serialized:
          return self._encode_example_cache.SerializeToString()
  
      result = tf.train.Example()
      result.CopyFrom(self._encode_example_cache)
      return result
  
file_path: transform/tensorflow_transform/coders/example_proto_coder.py
imports: import numpy
  import tensorflow
  from tensorflow_transform.tf_metadata import schema_utils
label_desc: Use image node_id 3 for calling the ExampleProtoCoder obj's underlying member method code with example usage: obj.encode(instance) and returns: result, self