Return x % size or x % size - size or 0 where x and size are np.array of same shape
x % size
x % size - size
0
x
size