'Copy from the provided array into this array.
This may be less forgiving than the CUDA Python implementation, which
will copy data up to the length of the smallest of the two arrays,
whereas this expects the size of the arrays to be equal.'

def copy_to_device(self, ary, stream=0):

    try:
        np.copyto(self._ary, ary)
    except AttributeError:
        self._ary[:] = ary
