Created
November 20, 2022 11:38
-
-
Save osbm/c56db8d313e25bfb24f5f72144872076 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # stfu tensorflow | |
import tensorflow as tf | |
x = tf.constant(3.0) | |
print(x) | |
with tf.GradientTape() as tape: | |
tape.watch(x) | |
y = x * x | |
dy_dx = tape.gradient(y, x) | |
print(dy_dx) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Suppress tensorflow warnings and example usage of
tf.GradienTape