fork download
  1. import tensorflow as tf
  2. import tensorflow as tf
  3. x = tf.convert_to_tensor(2.0)
  4. with tf.GradientTape() as tape:
  5. tape.watch(x)
  6. y = x*x-2
  7. z = y*x
  8. grads = tape.gradient(z,x)
Success #stdin #stdout 1.16s 197620KB
stdin
Standard input is empty
stdout
Standard output is empty