Replace transform by vectorized_transform.