<kaggle_start><code># Install `tensorflow-datasets`.

# Define wrapper.
# from https://www.tensorflow.org/datasets/add_dataset
import tensorflow_datasets.public_api as tfds


class MyDataset(tfds.core.GeneratorBasedBuilder):
    """Short description of my dataset."""

    VERSION = tfds.core.Version("0.1.0")

    def _info(self):
        # Specifies the tfds.core.DatasetInfo object
        pass  # TODO

    def _split_generators(self, dl_manager):
        # Downloads the data and defines the splits
        # dl_manager is a tfds.download.DownloadManager that can be used to
        # download and extract URLs
        pass  # TODO

    def _generate_examples(self):
        # Yields examples from the dataset
        yield "key", {}


# Supposing the above had been attached as a utility script `dataset.py`, we just import the wrapper to make the loader aware of it, and then point it to wherever the it's living on Kaggle.
from dataset import MyDataset
from kaggle_datasets import KaggleDatasets

if tpu:
    DATA_DIR = KaggleDatasets().get_gcs_path("my-dataset")
else:
    DATA_DIR = "/kaggle/input/my-dataset"

# And now we're set!
ds = tfds.load("my_dataset", split=["train", "test"], data_dir=DATA_DIR)
<|endoftext|>
[{"Id": 35536478, "ScriptId": 9936942, "ParentScriptVersionId": NaN, "ScriptLanguageId": 9, "AuthorUserId": 2003505, "CreationDate": "06/05/2020 17:52:48", "VersionNumber": 1.0, "Title": "TFDS Example", "EvaluationDate": "06/05/2020", "IsChange": true, "TotalLines": 42.0, "LinesInsertedFromPrevious": 42.0, "LinesChangedFromPrevious": 0.0, "LinesUnchangedFromPrevious": 0.0, "LinesInsertedFromFork": NaN, "LinesDeletedFromFork": NaN, "LinesChangedFromFork": NaN, "LinesUnchangedFromFork": NaN, "TotalVotes": 0}]
# Install `tensorflow-datasets`.

# Define wrapper.
# from https://www.tensorflow.org/datasets/add_dataset
import tensorflow_datasets.public_api as tfds


class MyDataset(tfds.core.GeneratorBasedBuilder):
    """Short description of my dataset."""

    VERSION = tfds.core.Version("0.1.0")

    def _info(self):
        # Specifies the tfds.core.DatasetInfo object
        pass  # TODO

    def _split_generators(self, dl_manager):
        # Downloads the data and defines the splits
        # dl_manager is a tfds.download.DownloadManager that can be used to
        # download and extract URLs
        pass  # TODO

    def _generate_examples(self):
        # Yields examples from the dataset
        yield "key", {}


# Supposing the above had been attached as a utility script `dataset.py`, we just import the wrapper to make the loader aware of it, and then point it to wherever the it's living on Kaggle.
from dataset import MyDataset
from kaggle_datasets import KaggleDatasets

if tpu:
    DATA_DIR = KaggleDatasets().get_gcs_path("my-dataset")
else:
    DATA_DIR = "/kaggle/input/my-dataset"

# And now we're set!
ds = tfds.load("my_dataset", split=["train", "test"], data_dir=DATA_DIR)
