Skip to content

Instantly share code, notes, and snippets.

@solaris33
Created May 13, 2020 12:04
Show Gist options
  • Save solaris33/0559adc579ec2fb8eb3e1c09bf1f5bcd to your computer and use it in GitHub Desktop.
Save solaris33/0559adc579ec2fb8eb3e1c09bf1f5bcd to your computer and use it in GitHub Desktop.
W = tf.Variable(tf.ones(shape=(2,2)), name="W")
b = tf.Variable(tf.zeros(shape=(2)), name="b")
@tf.function
def forward(x):
return W * x + b
out_a = forward([1,0])
print(out_a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment