Train/Test-Time Adaptation with Retrieval