class_docstr: DatasetBuilder for ogbg_molpcba dataset.
docstr: Yields examples.
docstr_tok: ["Yields","examples","."]
code: def _generate_examples(
      self, all_data: ArrayDict, split_indices: np.ndarray
  ):
      """Yields examples."""
      # Precompute for later.
      num_total_graphs = len(all_data["labels"])
      split_indices = set(split_indices)
      accumulated_num_nodes = np.concatenate(
          [np.array([0]), np.cumsum(all_data["num_nodes"])]
      )
      accumulated_num_edges = np.concatenate(
          [np.array([0]), np.cumsum(all_data["num_edges"])]
      )
  
      # Loop over the training set.
      for idx in range(num_total_graphs):
          # Check if this example is part of the split.
          if idx not in split_indices:
              continue
  
          # Read all of the graph information.
          labels = all_data["labels"][idx]
          num_nodes = all_data["num_nodes"][idx]
          node_slice = slice(
              accumulated_num_nodes[idx], accumulated_num_nodes[idx + 1]
          )
          node_feat = all_data["node_feat"][node_slice]
          num_edges = all_data["num_edges"][idx]
          edge_slice = slice(
              accumulated_num_edges[idx], accumulated_num_edges[idx + 1]
          )
          edge_feat = all_data["edge_feat"][edge_slice]
          edge_index = all_data["edge_index"][edge_slice]
  
          # Combine into a single dictionary.
          record = {
              "labels": labels,
              "num_nodes": num_nodes,
              "node_feat": node_feat,
              "num_edges": num_edges,
              "edge_feat": edge_feat,
              "edge_index": edge_index,
          }
          yield idx, record
  
file_path: datasets/tensorflow_datasets/datasets/ogbg_molpcba/ogbg_molpcba_dataset_builder.py
imports: from typing import Dict, Text, Tuple
  from etils import epath
  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(all_data, split_indices) without return types