import tensorflow as tf

        dataset = utils.read_tfrecord_files(input_files, **kwargs)
        d = cls(examples=None, **kwargs)
        # parse example
        features = {
            d.input_ids: tf.io.VarLenFeature(tf.int64),
            d.token_type_ids: tf.io.VarLenFeature(tf.int64),
            d.attention_mask: tf.io.VarLenFeature(tf.int64),
            d.labels: tf.io.VarLenFeature(tf.int64),
        }
        dataset = dataset.map(
            lambda x: tf.io.parse_example(x, features),
            num_parallel_calls=utils.AUTOTUNE,
        ).prefetch(utils.AUTOTUNE)
        dataset = dataset.map(
            lambda x: (
                tf.cast(tf.sparse.to_dense(x[d.input_ids]), tf.int32),
                tf.cast(tf.sparse.to_dense(x[d.token_type_ids]), tf.int32),
                tf.cast(tf.sparse.to_dense(x[d.attention_mask]), tf.int32),
                tf.cast(tf.sparse.to_dense(x[d.labels]), tf.int32),
            ),
            num_parallel_calls=utils.AUTOTUNE,
        ).prefetch(utils.AUTOTUNE)
        # do transformation
        return d(dataset, **kwargs)

    def parse_examples_to_dataset(self):
        if not self.examples:
            logging.info("self.examples is empty or None, skipped.")
            return None
        input_ids, token_type_ids, attention_mask, labels = [], [], [], []
