Just for fun,
I think you can also do it with:

Average pooling with kernel [1, 2] and stride [1, 2].
Flip the sign of every other row
Sum every pair of rows.

I don’t think that’s going to be more efficient than @ptrblck 's solution though …