I have a tensor A of size torch.Size([3])
and another tensor B of size torch.Size([4,3])
.
I want to find the distance between A and each of the 4 rows of B.
I'm new to Torch and I reckon a for loop for each of the rows wouldn't be efficient. I have looked into torch.linalg.norm
and torch.cdist
but I'm not sure if they solve my problem, unless I'm missing something.