Stanford University said the use of artificial intelligence to alter the race and appearance of students in a promotional photo violated its policy and was “a serious error in judgment.”