Checks if two tensors have equal sizes.