import tensorflow as tf

  def next_num(num):
    # This creates a cycle of length 136.
    return tf.mod((num * 13), 137)

  num = tf.reshape(tf.mod(seed, 136) + 1, (1,))
  result = num
  for _ in range(num_elements - 1):
    num = next_num(num)
    result = tf.concat([result, num], 0)
  return tf.to_float(result)


@encoding_stage.tf_style_encoding_stage
class PlusRandomNumEncodingStage(encoding_stage.EncodingStageInterface):
  """[Example] encoding stage, adding random values given a random seed.

