Skip to content

Instantly share code, notes, and snippets.

import numpy as np
import tensorflow as tf
input_tensor = tf.constant(1, dtype=tf.int64)
keys = tf.constant(np.array([1,2,3]), dtype=tf.int64)
values = tf.constant(np.array([4,5,6]), dtype=tf.int64)
default_value = tf.constant(-1, dtype=tf.int64)
table = tf.contrib.lookup.HashTable(