In [1]:
import tensorflow as tf
import numpy as np
import pandas as pd

In [15]:
logits = tf.Variable(np.array([[0.1, 0.5, 0.4], [0.5, 0.1, 0.4]]), dtype=tf.float32, name="logits")
y = tf.Variable(np.array([1, 1]), dtype=tf.int32, name="y")
correct = tf.nn.in_top_k(logits, y, 1)

In [16]:
init = tf.global_variables_initializer()

In [17]:
with tf.Session() as sess:
    init.run()
    result = sess.run(correct)
    print(result)


[ True False]