import tensorflow as tf

        dnn_output_size = rnn_output_size
        if do_dnn:
            last_layer = rnn_output
            last_layer_size = rnn_output_size
            for i, layer_size in enumerate(dnn_sizes):
                layer_name = 'dnn_{}'.format(i)
                with tf.variable_scope(layer_name):
                    dnn_w = tf.get_variable('W', shape=[last_layer_size, layer_size], initializer=dnn_init, dtype=dtype)
                    dnn_b = tf.get_variable('b', shape=[layer_size], initializer=tf.constant_initializer(0.0), dtype=dtype)
                projected = tf.nn.bias_add(tf.matmul(last_layer, dnn_w), dnn_b)
                # TODO: argument nonlinearity, change bias to 0.1 if relu
                if dnn_nonlin == 'tanh':
                    last_layer = tf.nn.tanh(projected)
                elif dnn_nonlin == 'sigmoid':
                    last_layer = tf.nn.sigmoid(projected)
                elif dnn_nonlin == 'relu':
                    last_layer = tf.nn.relu(projected)
                else:
                    raise NotImplementedError()
                if mode == 'train' and dnn_keep_prob < 1.0:
                    last_layer = tf.nn.dropout(last_layer, dnn_keep_prob)
                last_layer_size = layer_size
                print('{}: {}'.format(layer_name, last_layer.get_shape()))

