class_docstr: ## Dataset
  
  This is the PyTorch dataset that loads the dataset created
  by `build_dataset`.
docstr: * `file_path` is the path of the saved JSON file
  * `tds` is the `TextDataset`
docstr_tok: ["*","`","file_path","`","is","the","path","of","the","saved","JSON","file","*","`","tds","`","is","the","`","TextDataset","`"]
code: def __init__(self, file_path: Path, tds: TextDataset):
      """
      * `file_path` is the path of the saved JSON file
      * `tds` is the `TextDataset`
      """
  
      self.tds = tds
      # Load the samples
      with open(str(file_path), "r") as f:
          self.samples = json.loads(f.read())
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/transformers/retro/dataset.py
imports: import json
  from pathlib import Path
  import numpy
  import torch
  from torch.utils.data import Dataset
  from labml import lab, monit
  from labml_helpers.datasets.text import TextFileDataset, TextDataset
  from labml_nn.transformers.retro.database import RetroIndex
label_desc: Use image node_id 1 to create a new Dataset object from inherited base classes: PyTorchDataset with example: obj = Dataset(file_path, tds)