Skip to content

Instantly share code, notes, and snippets.

@chaserileyroberts
Last active October 15, 2017 04:47
Show Gist options
  • Save chaserileyroberts/bc984baffcc1b550025745214bd5aefc to your computer and use it in GitHub Desktop.
Save chaserileyroberts/bc984baffcc1b550025745214bd5aefc to your computer and use it in GitHub Desktop.
def test_loss():
in_tensor = tf.placeholder(tf.float32, (None, 3))
labels = tf.placeholder(tf.int32, None, 1))
model = Model(in_tensor, labels)
sess = tf.Session()
loss = sess.run(model.loss, feed_dict={
in_tensor:np.ones(1, 3),
labels:[[1]]
})
assert loss != 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment