def get_serialized_info(self):
    """See base class for details."""
    # Add the additional length dimension to every serialized features

    def add_length_dim(serialized_info):
      """Add the length dimension to the serialized_info.

      Args:
        serialized_info: One of tf.io.FixedLenFeature, tf.io.VarLenFeature,...

      Returns:
        new_serialized_info: serialized_info with extended first dimension
      """
      if isinstance(serialized_info, tf.io.FixedLenFeature):
        if self._length is not None:
          return tf.io.FixedLenFeature(
              shape=(self._length,) + serialized_info.shape,
              dtype=serialized_info.dtype,
          )
        else:
          return tf.io.FixedLenSequenceFeature(
              shape=serialized_info.shape,
              dtype=serialized_info.dtype,
              allow_missing=True,
          )
      elif isinstance(serialized_info, tf.io.VarLenFeature):
        return serialized_info
      else:
        raise ValueError(
            'FixedLenSequenceFeature not supported inside SequenceDict'
        )
      return serialized_info

    tensor_info = super(SequenceDict, self).get_serialized_info()
    return utils.map_nested(add_length_dim, tensor_info)
See base class for details.