np.unique returns all unique values in the numpy array.
If there are only two unique values, you will just get these two.
I’m currently not sure, what your code is doing and what the dimensions refer to.
Could you explain your use case a bit?