class_docstr: Tensorflow Example proto decoder.
docstr: Decode the serialized example.
  
  Args:
    serialized_example: a single serialized tf.Example string.
  
  Returns:
    decoded_tensors: a dictionary of tensors with the following fields:
      - image: a uint8 tensor of shape [None, None, 3].
      - height: an integer scalar tensor.
      - width: an integer scalar tensor.
      - groundtruth_classes: a int64 tensor of shape [None].
      - groundtruth_boxes: a float32 tensor of shape [None, 4].
docstr_tok: ["Decode","the","serialized","example",".","Args",":","serialized_example",":","a","single","serialized","tf.Example","string",".","Returns",":","decoded_tensors",":","a","dictionary","of","tensors","with","the","following","fields",":","-","image",":","a","uint8","tensor","of","shape","[","None",",","None",",","3","]",".","-","height",":","an","integer","scalar","tensor",".","-","width",":","an","integer","scalar","tensor",".","-","groundtruth_classes",":","a","int64","tensor","of","shape","[","None","]",".","-","groundtruth_boxes",":","a","float32","tensor","of","shape","[","None",",","4","]","."]
code: def decode(self, serialized_example):
      """Decode the serialized example.
  
      Args:
        serialized_example: a single serialized tf.Example string.
  
      Returns:
        decoded_tensors: a dictionary of tensors with the following fields:
          - image: a uint8 tensor of shape [None, None, 3].
          - height: an integer scalar tensor.
          - width: an integer scalar tensor.
          - groundtruth_classes: a int64 tensor of shape [None].
          - groundtruth_boxes: a float32 tensor of shape [None, 4].
      """
      parsed_tensors = tf.io.parse_single_example(
          serialized_example, self._keys_to_features
      )
      for k in parsed_tensors:
          if isinstance(parsed_tensors[k], tf.SparseTensor):
              if parsed_tensors[k].dtype == tf.string:
                  parsed_tensors[k] = tf.sparse_tensor_to_dense(
                      parsed_tensors[k], default_value=""
                  )
              else:
                  parsed_tensors[k] = tf.sparse_tensor_to_dense(
                      parsed_tensors[k], default_value=0
                  )
  
      image = self._decode_image(parsed_tensors)
      boxes = self._decode_boxes(parsed_tensors)
  
      decode_image_shape = tf.logical_or(
          tf.equal(parsed_tensors["image/height"], -1),
          tf.equal(parsed_tensors["image/width"], -1),
      )
      image_shape = tf.cast(tf.shape(image), dtype=tf.int64)
  
      parsed_tensors["image/height"] = tf.where(
          decode_image_shape,
          image_shape[0],
          parsed_tensors["image/height"],
      )
      parsed_tensors["image/width"] = tf.where(
          decode_image_shape,
          image_shape[1],
          parsed_tensors["image/width"],
      )
  
      decoded_tensors = {
          "image": image,
          "height": parsed_tensors["image/height"],
          "width": parsed_tensors["image/width"],
          "groundtruth_classes": parsed_tensors[
              "image/object/class/label"
          ],
          "groundtruth_boxes": boxes,
      }
      return decoded_tensors
  
imports: import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling the TfExampleDecoder obj's underlying member method code with example usage: obj.decode(serialized_example) and returns: decoded_tensors