title: tf.placeholder inside a class in TF 2.0
body: <p>I'm trying to change a code I have written in TF 1.0 to TF 2.0 and I'm having difficulties with replacing the <strong>tf.placeholder</strong> inside a class function. My code is the following</p>
  
  <pre><code>class User:
      x = tf.placeholder(tf.float32,shape=[None,784])
      y_true = tf.placeholder(tf.float32, [None, 10])
  
      W1 = tf.Variable(tf.random.truncated_normal([7840,1], stddev=0.1))
      lambda_W = tf.Variable(tf.zeros([7840,1]))    
      W = tf.reshape(W1,[784, 10])
  
      ylogits = W*x
      y = tf.nn.softmax(ylogits)
      def __init__(self):
          pass
  </code></pre>
  
  <p>Is there a way to replace tf.placeholder inside the class to make code running in TF 2.0?</p>