'Check that regression does not duplicate placeholders'

def test_regression_placeholder(self):

    with tf.Graph().as_default():
        g = tflearn.input_data(shape=[None, 2])
        g_nand = tflearn.fully_connected(g, 1, activation='linear')
        with tf.name_scope('Y'):
            Y_in = tf.placeholder(shape=[None, 1], dtype=tf.float32, name='Y')
        tflearn.regression(g_nand, optimizer='sgd', placeholder=Y_in, learning_rate=2.0, loss='binary_crossentropy', op_name='regression1', name='Y')
        tflearn.regression(g_nand, optimizer='adam', placeholder=Y_in, learning_rate=2.0, loss='binary_crossentropy', op_name='regression2', name='Y')
        self.assertEqual(len(tf.get_collection(tf.GraphKeys.TARGETS)), 1)
