Tensorflow: Finding index of first occurrence of elements in a tensor
One possibilty would be to use x.eval() which gives you a numpy array back,
then use numpy.unique(...)
Suppose I have a tensor, x = [1, 2, 6, 6, 4, 2, 3, 2]
I want to find the index of the first occurrence of every unique element in x.
The output should be [0, 1, 6, 4, 2].
I basically want the second output of numpy.unique(x,return_index=True). This functionality doesn't seem to be supported in tf.unique. 
Is there a workaround to this in tensorflow, without using any loops?