class_docstr: PatchCamelyon.
class_docstr_tok: ["PatchCamelyon","."]
docstr: Generates images and labels given the image directory path.
  
  Args:
    split: name of the split to generate examples for (test, train, valid).
    paths: dictionary with the paths to the h5 files for each split.
  
  Yields:
    A dictionary with the image and the corresponding label.
docstr_tok: ["Generates","images","and","labels","given","the","image","directory","path",".","Args",":","split",":","name","of","the","split","to","generate","examples","for","(","test",",","train",",","valid",")",".","paths",":","dictionary","with","the","paths","to","the","h5","files","for","each","split",".","Yields",":","A","dictionary","with","the","image","and","the","corresponding","label","."]
code: def _generate_examples(self, split, paths):
      """Generates images and labels given the image directory path.
  
      Args:
        split: name of the split to generate examples for (test, train, valid).
        paths: dictionary with the paths to the h5 files for each split.
  
      Yields:
        A dictionary with the image and the corresponding label.
      """
      h5py = tfds.core.lazy_imports.h5py
  
      filepath_x = paths[split + "_x"]
      filepath_y = paths[split + "_y"]
      with h5py.File(filepath_x, "r") as f_x, h5py.File(
          filepath_y, "r"
      ) as f_y:
          images = f_x["x"]
          labels = f_y[
              "y"
          ]  # Note: Labels are in a N x 1 x 1 x 1 tensor.
  
          for i, (image, label) in enumerate(zip(images, labels)):
              label = label.flatten()[0]
              id_ = "%s_%d" % (split, i)
              record = {"id": id_, "image": image, "label": label}
              yield id_, record
  
imports: import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the Builder obj's underlying member method code with example usage: obj._generate_examples(split, paths) without return types