Skip to content

Instantly share code, notes, and snippets.

@Pythonista7
Created September 30, 2021 14:13
Show Gist options
  • Save Pythonista7/16e7f0e0fe826c91dcfc9d71b8f14bf5 to your computer and use it in GitHub Desktop.
Save Pythonista7/16e7f0e0fe826c91dcfc9d71b8f14bf5 to your computer and use it in GitHub Desktop.
>>> import tensorflow as tf
>>> a = tf.constant(2)
>>> a
<tf.Tensor: shape=(), dtype=int32, numpy=2>
>>> b = tf.constant(3)
>>> c = tf.constant(5)
>>>
>>> tf.add(a, b)
<tf.Tensor: shape=(), dtype=int32, numpy=5>
>>> tf.subtract(a, b)
<tf.Tensor: shape=(), dtype=int32, numpy=-1>
>>> tf.multiply(a, b)
<tf.Tensor: shape=(), dtype=int32, numpy=6>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment