Using einsum for transpose times matrix times transpose: x@A^T@A@x^T@x@A@A^T@x^T
So I have m number of different vectors (say x), each one is (1,n), stacked horizontally, totally in a (m,n) matrix we call it B, and a matrix (A) with dimension (n,n).
How to implement in pytorch – numpy’s .unique WITH(!) return_index = True?
In numpy.unique where is an option return_index=True – which returns positions of unique elements (first occurrence if several).