Skip to content

Commit

Permalink
Update GradientTape.py
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYang1994 authored Mar 8, 2019
1 parent ac040f2 commit 98e1b5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 1-Introduction/GradientTape.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

x = tf.constant(3.0)
with tf.GradientTape(persistent=True) as t:
t.watch(x)
t.watch(x) # Ensures that `tensor` is being traced by this tape.
y = x * x
z = y * y
dz_dx = t.gradient(z, x) # 108.0 (4*x^3 at x = 3)
Expand Down

0 comments on commit 98e1b5c

Please sign in to comment.