Skip to content

Instantly share code, notes, and snippets.

@fabclmnt
Created May 7, 2020 14:34
Show Gist options
  • Save fabclmnt/626bf0489f2a246038b805d2ff1a3c53 to your computer and use it in GitHub Desktop.
Save fabclmnt/626bf0489f2a246038b805d2ff1a3c53 to your computer and use it in GitHub Desktop.
import tensorflow as tf
# Creating tensorflow constants
a = tf.constant([[1, 2], [3, 4]])
b = tf.constant([[1, 2], [3, 4]])
# Summing the two tensors
c = a + b
# Printing the results
print(c)
# Converting tensor to numpy
b = a.numpy()
print(b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment