Tesla's head of autopilot software, Chris Lattner, has left the company after less than six months with the electric carmaker.