[BUG] Do a copy when NumPy didn't allocate new memory.

An opt will remove this case if the repeat pattern is a constant 1.