Cosine distance is using max() in denominator

In math cosine distance (or similarity) is calculated as
But according to pytorch documentation, it’s calulated as

Can someone explain the difference, please?

The max operation just prevents dividing by zero or a very small number smaller than eps.
Besides that both formulas are equal.

oops, I didn’t see the dot sign :sweat_smile: