OK, I see that. Sorry for being confused.

Now I have another question. Should we calculate in terms of vectorized?
My point is that, usually in ML we want to calculate the L1 distance between vectors instead of matrix. We may put all vectors in matrix form, but what we want is vector-wise computation.
Here is what I mean: http://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.manhattan_distances.html#sklearn.metrics.pairwise.manhattan_distances

Once again, sorry for confusion, and thanks for your explanation!