title: `tape` is required when a `Tensor` loss is passed
body: <p>Some question about tf.</p>
  <pre><code>import numpy as np
  import tensorflow as tf
  from tensorflow import keras
  
  x_train = [1,2,3]
  y_train = [1,2,3]
  
  W = tf.Variable(tf.random.normal([1]), name = 'weight')
  b = tf.Variable(tf.random.normal([1]), name = 'bias')
  hypothesis = W*x_train+b
  
  optimizer = tf.optimizers.SGD (learning_rate=0.01)
  
  train = tf.keras.optimizers.Adam().minimize(cost, var_list=[W, b])
  </code></pre>
  <p>As I start the last line of my code, below error comes out.</p>
  <pre><code>---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-52-cd6e22f66d09&gt; in &lt;module&gt;()
  ----&gt; 1 train = tf.keras.optimizers.Adam().minimize(cost, var_list=[W, b])
  
  1 frames
  /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/optimizer_v2/optimizer_v2.py in _compute_gradients(self, loss, var_list, grad_loss, tape)
      530     # TODO(josh11b): Test that we handle weight decay in a reasonable way.
      531     if not callable(loss) and tape is None:
  --&gt; 532       raise ValueError(&quot;`tape` is required when a `Tensor` loss is passed.&quot;)
      533     tape = tape if tape is not None else backprop.GradientTape()
      534 
  
  ValueError: `tape` is required when a `Tensor` loss is passed.
  </code></pre>
  <p>I know it is related with tensorflow version 2, but don't want to modify to version 1.</p>
  <p>Want a solution with tensorflow ver2. Thx.</p>