Fold in the gradient

Change-Id: I431b96cc00343492e0cac255b3b9482a780d7749