Checks if the dimensions of two vectors are equal.