Would the following work?  Would it use less memory?
TwoAB = 2 * A @ B.transpose(0,1)
print(torch.sqrt(torch.sum(A * A, 1).expand_as(TwoAB) + torch.sum(B * B, 1).transpose(0,1).expand_as(TwoAB) - TwoAB))

(here A is one matrix, and B is the other. In this thread’s case, they’d both be V)