def name_to_batch(name, batch_size, num_steps):
 data = np.zeros(((batch_size * num_steps) + 1))
 data_index = 0
 for letter in (map(_letter_to_number, name) + [_EON]):
  data[data_index] = letter
  data_index += 1
 x = data[:(batch_size * num_steps)].reshape((batch_size, num_steps))
 y = data[1:((batch_size * num_steps) + 1)].reshape((batch_size, num_steps))
 return (x, y)

def name_to_batch ( name , batch_size , num_steps ) : data = np . zeros ( ( ( batch_size * num_steps ) + 1 ) ) data_index = 0 for letter in ( map ( _letter_to_number , name ) + [ _EON ] ) : data [ data_index ] = letter data_index += 1 x = data [ : ( batch_size * num_steps ) ] . reshape ( ( batch_size , num_steps ) ) y = data [ 1 : ( ( batch_size * num_steps ) + 1 ) ] . reshape ( ( batch_size , num_steps ) ) return ( x , y )
takes a single name and fills a batch with it args: name: lowercase composed of 26 characters batch_size: int num_steps: int returns: x .