Elon Musk has warned on several occasions about the dangers of artificial intelligence.