If you don’t have too many of these Tensors, I think a for loop around your original distance function above is the best 
If you have many many of them, then the cat operation will be faster (though more memory hungry as you mentionned).