Jorge Sampaoli has resigned as Chile head coach.