Compute the moving average of vector Z over a sliding window of size n.
Return a vector of length len(Z) - n + 1, where element i is the mean of
Z[i:i+n].
Input
Z = tensor([ 0, 1, 2, ..., 17, 18, 19])
n = 3
Output
tensor([ 1., 2., 3., ..., 16., 17., 18.])