title: TensorFlow Dimensions error when using the same object twice in call par of the custom model
body: <p>This is my custom dense model:</p>
  <pre><code>class DenseModel(Model):
  def __init__(self):
      super(DenseModel, self).__init__(name='class_dense_model')
      self.dense_1 = layers.Dense(1)
      self.dense_64 = layers.Dense(64, activation=tf.nn.relu)
      self.dense_100 = layers.Dense(100, activation=tf.nn.relu)
      self.dense_200 = layers.Dense(200, activation=tf.nn.relu)
      self.dense_200_2 = layers.Dense(200, activation=tf.nn.relu)
  
  def call(self, input_tensor, training=False, **kwargs):
      out_1 = self.dense_64(input_tensor)
      out_2 = self.dense_100(out_1)
      out_3 = self.dense_200(out_2)
      out_4 = self.dense_200(out_3)
      return self.dense_1(out_4)
  
      
  
  def build_graph(self, shape):
      x = tf.keras.layers.Input(shape=shape)
      return Model(inputs=[x], outputs=self.call(x))
  </code></pre>
  <p>This doesn't work, but when I change <code>out_4 = self.dense_200(out_3)</code> into <code>out_4 = self.dense_200_2(out_3)</code> it works. I don't have any idea why is this happening.</p>
  <p>As we can see, the error is caused when using the same object twice. This shouldn't happen. The error is:</p>
  <p><strong>ValueError: Dimensions must be equal, but are 200 and 100 for '{{node dense_5/MatMul}} = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false](Placeholder, dense_5/MatMul/ReadVariableOp)' with input shapes: [?,200], [100,200].</strong></p>
  <p>I build the model like this:</p>
  <pre><code>model = DenseModel()
  model.build_graph(INPUT_SHAPE)
  </code></pre>
  <p>Where did I do wrong?</p>