He cut three officers with a sword before he was shot in his apartment