'Sync the data in one memory space with the other.'

def _sync(self, where):

    if (where == 'gpu'):
        if (self._gpu is None):
            self._allocate('gpu', None, self.dtype, self.shape, self.strides)
        if (not self._gpu_valid):
            self._copy_to_gpu()
    else:
        if (self._host is None):
            self._allocate('host', None, self.dtype, self.shape, self.strides)
        if (not self._host_valid):
            self._copy_to_host()
