class_docstr: A data generator for use with the Watch Your Step algorithm [1]. It calculates and returns the first ``num_powers``
  of the adjacency matrix row by row.
  
  .. seealso::
  
     Model using this generator: :class:`.WatchYourStep`.
  
     Example using this generator: `unsupervised representation learning <https://stellargraph.readthedocs.io/en/stable/demos/embeddings/watch-your-step-embeddings.html>`__
  
  Args:
      G (StellarGraph): a machine-learning StellarGraph-type graph
      num_powers (int): the number of adjacency powers to calculate. Defaults
          to 10 as this value was found to perform well by the authors of the paper.
      weighted (bool, optional): if True, use the edge weights from ``G``; if False, treat the
          graph as unweighted.
docstr: Creates the `tensorflow.data.Dataset` object for training node embeddings from powers of the adjacency matrix.
  
  Args:
      batch_size (int): the number of rows of the adjacency powers to include in each batch.
      num_parallel_calls (int): the number of threads to use for preprocessing of batches.
  
  Returns:
      A `tensorflow.data.Dataset` object for training node embeddings from powers of the adjacency matrix.
docstr_tok: ["Creates","the","`","tensorflow.data.Dataset","`","object","for","training","node","embeddings","from","powers","of","the","adjacency","matrix",".","Args",":","batch_size","(","int",")",":","the","number","of","rows","of","the","adjacency","powers","to","include","in","each","batch",".","num_parallel_calls","(","int",")",":","the","number","of","threads","to","use","for","preprocessing","of","batches",".","Returns",":","A","`","tensorflow.data.Dataset","`","object","for","training","node","embeddings","from","powers","of","the","adjacency","matrix","."]
code: def flow(self, batch_size, num_parallel_calls=1):
      """
      Creates the `tensorflow.data.Dataset` object for training node embeddings from powers of the adjacency matrix.
  
      Args:
          batch_size (int): the number of rows of the adjacency powers to include in each batch.
          num_parallel_calls (int): the number of threads to use for preprocessing of batches.
  
      Returns:
          A `tensorflow.data.Dataset` object for training node embeddings from powers of the adjacency matrix.
      """
  
      require_integer_in_range(batch_size, "batch_size", min_val=1)
      require_integer_in_range(
          num_parallel_calls, "num_parallel_calls", min_val=1
      )
  
      row_dataset = tf.data.Dataset.from_tensor_slices(
          tf.sparse.eye(int(self.Aadj_T.shape[0]))
      )
  
      adj_powers_dataset = row_dataset.map(
          lambda ohe_rows: _partial_powers(
              ohe_rows,
              self.transition_matrix_T,
              num_powers=self.num_powers,
          ),
          num_parallel_calls=num_parallel_calls,
      )
  
      row_index_dataset = tf.data.Dataset.range(self.Aadj_T.shape[0])
  
      row_index_adj_powers_dataset = tf.data.Dataset.zip(
          (row_index_dataset, adj_powers_dataset)
      )
  
      batch_adj_dataset = row_dataset.map(
          lambda ohe_rows: _select_row_from_sparse_tensor(
              ohe_rows, self.Aadj_T
          ),
          num_parallel_calls=num_parallel_calls,
      )
  
      training_dataset = tf.data.Dataset.zip(
          (row_index_adj_powers_dataset, batch_adj_dataset)
      ).batch(batch_size)
  
      return training_dataset.repeat()
  
file_path: stellargraph/stellargraph/mapper/adjacency_generators.py
imports: import tensorflow
  from tensorflow.keras import backend
  import numpy
  from ..core import StellarGraph
  from ..core.validation import require_integer_in_range
  from ..core.utils import normalize_adj
  from .base import Generator
label_desc: Use image node_id 3 for calling the AdjacencyPowerGenerator obj's underlying member method code with example usage: obj.flow(batch_size, num_parallel_calls) and returns: training_dataset