U can read up the theory of the cosine similarly and the cross entropy on pytorch.org 31
The reason y I chose plan 1 over 2 is this computation time and memory allocation u see plan 2 theoretically is supposed to give better accuracy as it is using the Cos embedding loss used for comparing if 2 values are equal but in practice they both will give u similar results