As Amazon culls its workforce, the company is pouring billions of dollars into its artificial intelligence infrastructure, leaving some employees wondering whether the trade-off is worth it.