code: def language_model_gen(batch_size, vocab_size):
      """Generate x ~ prod p(x_t | x_{<t}). Output [batch_size, timesteps]."""
      # Initialize data input randomly.
      x = tf.random_uniform(
          [FLAGS.batch_size], 0, vocab_size, dtype=tf.int32
      )
      h = tf.zeros([FLAGS.batch_size, FLAGS.hidden_size])
      c = tf.zeros([FLAGS.batch_size, FLAGS.hidden_size])
      xs = []
      for _ in range(FLAGS.timesteps):
          x = tf.one_hot(x, depth=vocab_size, dtype=tf.float32)
          h, c = lstm_cell(x, h, c, name="lstm")
          logits = tf.layers.dense(h, vocab_size, name="dense")
          x = Categorical(logits=logits).value()
          xs.append(x)
  
      xs = tf.cast(tf.stack(xs, 1), tf.int32)
      return xs
  
file_path: edward/examples/lstm.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import edward
  import numpy
  import os
  import string
  import tensorflow
  from datetime import datetime
  from edward.models import Categorical
  from edward.util import Progbar
  from observations import text8
label_desc: Use image node_id 4 for calling a global function with example usage: language_model_gen(batch_size, vocab_size) and returns: xs