(cell, z, name=None)
return tf.nest.pack_sequence_as(
      cell.zero_state(batch_size=z.shape[0], dtype=tf.float32),
      tf.split(
          tf.layers.dense(
              z,
              sum(flat_state_sizes),
              activation=tf.tanh,
              kernel_initializer=tf.random_normal_initializer(stddev=0.001),
              name=name),
          flat_state_sizes,
          axis=1))
Computes an initial RNN `cell` state from an embedding, `z`.
Computes an initial RNN `cell` state from an embedding, `z`.
Computes an initial RNN cell state from an embedding z .
def initial_cell_state_from_embedding(cell, z, name=None):
  """Computes an initial RNN `cell` state from an embedding, `z`."""
  flat_state_sizes = tf.nest.flatten(cell.state_size)
  return tf.nest.pack_sequence_as(
      cell.zero_state(batch_size=z.shape[0], dtype=tf.float32),
      tf.split(
          tf.layers.dense(
              z,
              sum(flat_state_sizes),
              activation=tf.tanh,
              kernel_initializer=tf.random_normal_initializer(stddev=0.001),
              name=name),
          flat_state_sizes,
          axis=1))
def initial_cell_state_from_embedding ( cell , z , name = None ) : flat_state_sizes = tf . nest . flatten ( cell . state_size ) return tf . nest . pack_sequence_as ( cell . zero_state ( batch_size = z . shape [ 0 ] , dtype = tf . float32 ) , tf . split ( tf . layers . dense ( z , sum ( flat_state_sizes ) , activation = tf . tanh , kernel_initializer = tf . random_normal_initializer ( stddev = 0.001 ) , name = name ) , flat_state_sizes , axis = 1 ) )