utils.py
def seq_ind_generator(num_seqs, shuffle=True):
  """ A sequence-index generator.

  Args:
    num_seqs: An integer. The number of sequences we'll be indexing.
    shuffle: A boolean. If true, randomly shuffle indices epoch by epoch.

  Yields:
    An integer in `[0, num_seqs)`.
  """

  seq_inds = list(range(num_seqs))
  while True:
    if shuffle:
      np.random.shuffle(seq_inds)
    for seq_ind in seq_inds:
      yield seq_ind
 A sequence-index generator.

  Args:
    num_seqs: An integer. The number of sequences we'll be indexing.
    shuffle: A boolean. If true, randomly shuffle indices epoch by epoch.

  Yields:
    An integer in `[0, num_seqs)`.
  
A sequence-index generator.
A sequence - index generator .
def seq_ind_generator(num_seqs, shuffle=True):
  seq_inds = list(range(num_seqs))
  while True:
    if shuffle:
      np.random.shuffle(seq_inds)
    for seq_ind in seq_inds:
      yield seq_ind
def seq_ind_generator ( num_seqs , shuffle = True ) : seq_inds = list ( range ( num_seqs ) ) while True : if shuffle : np . random . shuffle ( seq_inds ) for seq_ind in seq_inds : yield seq_ind
A sequence-index generator.
A sequence - index generator .
""" A sequence-index generator.

  Args:
    num_seqs: An integer. The number of sequences we'll be indexing.
    shuffle: A boolean. If true, randomly shuffle indices epoch by epoch.

  Yields:
    An integer in `[0, num_seqs)`.
  """
An integer in `[0, num_seqs)`.
An integer in ` [ 0 num_seqs ) ` .
num_seqs
An integer. The number of sequences we'll be indexing.
An integer . The number of sequences we ' ll be indexing .
shuffle
A boolean. If true, randomly shuffle indices epoch by epoch.
A boolean . If true randomly shuffle indices epoch by epoch .