Elon Musk’s ambitions for artificial intelligence are coming together in a former vacuum-cleaner factory in Memphis, Tennessee.