class_docstr: Testing layers from tflearn/layers
class_docstr_tok: ["Testing","layers","from","tflearn\/layers"]
docstr: Check that regression does not duplicate placeholders
docstr_tok: ["Check","that","regression","does","not","duplicate","placeholders"]
code: def test_regression_placeholder(self):
      """
      Check that regression does not duplicate placeholders
      """
  
      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",
          )
          # for this test, just use the same default trainable_vars
          # in practice, this should be different for the two regressions
          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
          )
  
file_path: tflearn/tests/test_layers.py
imports: import tensorflow.compat.v1
  import tflearn
  import unittest
  import os
label_desc: Use image node_id 4 for calling the TestLayers obj's underlying member method code with example usage: obj.test_regression_placeholder() without return types