Add infer_shape to the ops.
Add optimizations to make the gradient update inplace.  There are no tests yet.
Now the opt actually compute the right value and there is a test.