Skip to content

Instantly share code, notes, and snippets.

@jjone36
Last active August 22, 2019 13:44
Show Gist options
  • Save jjone36/5fc32d04427e51eaf1efb586abfd4ec3 to your computer and use it in GitHub Desktop.
Save jjone36/5fc32d04427e51eaf1efb586abfd4ec3 to your computer and use it in GitHub Desktop.
# 1. Create variables as a tensor
a = tf.constant(2, tf.int32)
b = tf.Variable(10, tf.float32)
# 2. Write opertaions between them
c = tf.multiply(a, b)
# 3. Initialize variables
init = tf.global_variables_initializer()
# 4. Create and run a Session
with tf.Session() as sess:
sess.run(init)
sess.run(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment