def generator(self, nbr_symbols, max_length, nbr_cases):
    'Generator for the shift task on sequences of symbols.\n\n    The length of the sequence is drawn uniformly at random from [1, max_length]\n    and then symbols are drawn uniformly at random from [0, nbr_symbols - shift]\n    until nbr_cases sequences have been produced (output[i] = input[i] + shift).\n\n    Args:\n      nbr_symbols: number of symbols to use in each sequence (input + output).\n      max_length: integer, maximum length of sequences to generate.\n      nbr_cases: the number of cases to generate.\n\n    Yields:\n      A dictionary {"inputs": input-list, "targets": target-list} where\n      target-list[i] = input-list[i] + shift.\n    '
    shift = 10
    for _ in range(nbr_cases):
        l = (np.random.randint(max_length) + 1)
        inputs = [np.random.randint((nbr_symbols - shift)) for _ in range(l)]
        (yield {'inputs': inputs, 'targets': [(i + shift) for i in inputs]})
Generator for the shift task on sequences of symbols.

The length of the sequence is drawn uniformly at random from [1, max_length]
and then symbols are drawn uniformly at random from [0, nbr_symbols - shift]
until nbr_cases sequences have been produced (output[i] = input[i] + shift).

Args:
  nbr_symbols: number of symbols to use in each sequence (input + output).
  max_length: integer, maximum length of sequences to generate.
  nbr_cases: the number of cases to generate.

Yields:
  A dictionary {"inputs": input-list, "targets": target-list} where
  target-list[i] = input-list[i] + shift.
def generator(self, nbr_symbols, max_length, nbr_cases):
    'Generator for the shift task on sequences of symbols.\n\n    The length of the sequence is drawn uniformly at random from [1, max_length]\n    and then symbols are drawn uniformly at random from [0, nbr_symbols - shift]\n    until nbr_cases sequences have been produced (output[i] = input[i] + shift).\n\n    Args:\n      nbr_symbols: number of symbols to use in each sequence (input + output).\n      max_length: integer, maximum length of sequences to generate.\n      nbr_cases: the number of cases to generate.\n\n    Yields:\n      A dictionary {"inputs": input-list, "targets": target-list} where\n      target-list[i] = input-list[i] + shift.\n    '
    shift = 10
    for _ in range(nbr_cases):
        l = (np.random.randint(max_length) + 1)
        inputs = [np.random.randint((nbr_symbols - shift)) for _ in range(l)]
        (yield {'inputs': inputs, 'targets': [(i + shift) for i in inputs]})