'Load data from parent cache.'

def LoadData(self):

    data_cpu = self.parent.Get(self._maxpos)
    datasize = data_cpu[0].shape[0]
    assert (datasize <= self._maxpos), ('GPU    cache    can    only    store    %d    datapoints,    but    parent    gave    it    %d.' % (self._maxpos, datasize))
    self.datasize = datasize
    for (i, d) in enumerate(data_cpu):
        if sp.issparse(d):
            mat = d.toarray().T
        else:
            mat = d.T
        size = (mat.shape[0] * mat.shape[1])
        if (size > self.allocated_memory_size[i]):
            self.data[i] = cm.CUDAMatrix(mat)
            self.allocated_memory_size[i] = (mat.shape[0] * mat.shape[1])
        else:
            self.data[i].overwrite(mat)
    self.Normalize()
