import tensorflow as tf


# In[2]:


def prenet(inputs, num_units=None, is_training=True, scope="prenet"):
    if num_units is None:
        num_units = [embed_size, embed_size // 2]
    with tf.variable_scope(scope):
        outputs = tf.layers.dense(inputs, units=num_units[0], activation=tf.nn.relu, name="dense1")
        outputs = tf.layers.dropout(
            outputs, rate=dropout_rate, training=is_training, name="dropout1"
        )
        outputs = tf.layers.dense(outputs, units=num_units[1], activation=tf.nn.relu, name="dense2")
        outputs = tf.layers.dropout(
            outputs, rate=dropout_rate, training=is_training, name="dropout2"
        )
    return outputs


def highwaynet(inputs, num_units=None, scope="highwaynet"):
    if not num_units:
        num_units = inputs.get_shape()[-1]
    with tf.variable_scope(scope):
        H = tf.layers.dense(inputs, units=num_units, activation=tf.nn.relu, name="dense1")
