Test-Time Training with Self-Supervision for Generalization under Distribution Shifts