Walmart's stock closed 3% higher on Tuesday, pushing the retailer's market valuation to $1 trillion as it emphasizes tech and convenience.