tf.io.decode_json_example

Convert JSON-encoded Example records to binary protocol buffer strings.

This op converts JSON-serialized tf.train.Example (maybe created with json_format.MessageToJson, following the standard JSON mapping) to a binary-serialized tf.train.Example (equivalent to Example.SerializeToString()) suitable for conversion to tensors with tf.io.parse_example.

Here is a tf.train.Example proto:

example = tf.train.Example(
  features=tf.train.Features(
      feature={
          "a": tf.train.Feature(
              int64_list=tf.train.Int64List(