class_docstr: So2SAT remote sensing dataset.
class_docstr_tok: ["So2SAT","remote","sensing","dataset","."]
docstr: Yields examples.
docstr_tok: ["Yields","examples","."]
code: def _generate_examples(self, path, selection):
      """Yields examples."""
      with tfds.core.lazy_imports.h5py.File(path, "r") as fid:
          sen1 = fid["sen1"]
          sen2 = fid["sen2"]
          label = fid["label"]
          for i in range(len(sen1)):
              if selection == "rgb":
                  record = {
                      "image": _create_rgb(sen2[i]),
                      "label": np.argmax(label[i]).astype(int),
                      "sample_id": i,
                  }
              elif selection == "all":
                  record = {
                      "sentinel1": sen1[i].astype(np.float32),
                      "sentinel2": sen2[i].astype(np.float32),
                      "label": np.argmax(label[i]).astype(int),
                      "sample_id": i,
                  }
              yield i, record
  
file_path: datasets/tensorflow_datasets/datasets/so2sat/so2sat_dataset_builder.py
imports: import numpy
  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(path, selection) without return types