Skip to content

Instantly share code, notes, and snippets.

@irdanish11
Created July 8, 2020 11:51
Show Gist options
  • Select an option

  • Save irdanish11/bb2d9f889d29a5299f4c5963bcf8dfe0 to your computer and use it in GitHub Desktop.

Select an option

Save irdanish11/bb2d9f889d29a5299f4c5963bcf8dfe0 to your computer and use it in GitHub Desktop.
b = None
@tf.function
def f():
a = tf.constant([[10, 10], [11., 1.]])
x = tf.constant([[1., 0.], [0., 1.]])
global b
if b is None:
b = tf.Variable(12.)
y = tf.matmul(a, x) + b
print("PRINT: ", y)
tf.print("TF-PRINT: ", y)
return y
f()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment