import tensorflow as tf

            q1_in_ph = tf.concat([x, a], axis=-1)
            q1_in_dim = q1_in_ph.shape.as_list()[1]
            q1_dropout_mask_generator = DropoutMaskGenerator(q1_in_dim, hidden_sizes, model_prob=1.0 - dropout_rate)
            q1_dropout_mask_phs = q1_dropout_mask_generator.generate_dropout_mask_placeholders()

            q1, q1_reg = mlp_variational(q1_in_ph, q1_dropout_mask_phs, list(hidden_sizes) + [1],
                                         activation, None, dropout_rate)
            q1 = tf.squeeze(q1, axis=2)
        with tf.variable_scope('q1', reuse=True):
            q1_pi, q1_pi_reg = mlp_variational(tf.concat([x, pi[0]], axis=-1), q1_dropout_mask_phs, list(hidden_sizes) + [1],
                                                activation, None, dropout_rate)
            q1_pi = tf.squeeze(q1_pi, axis=2)
        with tf.variable_scope('q2'):
            q2_in_ph = tf.concat([x, a], axis=-1)
            q2_in_dim = q2_in_ph.shape.as_list()[1]
            q2_dropout_mask_generator = DropoutMaskGenerator(q2_in_dim, hidden_sizes, model_prob=1.0 - dropout_rate)
            q2_dropout_mask_phs = q2_dropout_mask_generator.generate_dropout_mask_placeholders()

            q2, q2_reg = mlp_variational(q2_in_ph, q2_dropout_mask_phs, list(hidden_sizes) + [1],
                                         activation, None, dropout_rate)
            q2 = tf.squeeze(q2, axis=2)
    else:
