Could you explain the CosineEmbeddingLoss to me?

As I understand it, the CBL takes two matrices and calculates the angle between them. But Im not sure what the label y = 1 ; -1 does. Id say that when the label is 1, the aim is that these two matrices should be close to each other. But when its -1, they shouldnt be close to each other. But I guess thats not right. So what does y do? There is nothing in the doc about it (at least Im not finding it). Thanks alot!