def Load(self, name, batchsize=None, typesize=4):
    data_proto = self.data_proto
    try:
      this_set = next(d for d in data_proto.data if d.name == name)
    except __HOLE__ as e:
      print 'No data called %s found in proto file.' % name
      raise e

    filenames = sorted(glob.glob(os.path.join(data_proto.prefix,
                                              this_set.file_pattern)))
    numdims = np.prod(np.array(this_set.dimensions))
    numlabels = this_set.num_labels
    key = this_set.key
    self.numdims = numdims * numlabels
    datasetsize = this_set.size
    if batchsize is None:
      batchsize = datasetsize
    self.batchsize = batchsize
    total_disk_space = datasetsize * numdims * typesize
    self.numbatches = datasetsize / batchsize
    max_cpu_capacity = min(total_disk_space, GetBytes(data_proto.main_memory))
    self.num_cpu_batches = max_cpu_capacity / (typesize * numdims * batchsize)
    cpu_capacity = self.num_cpu_batches * batchsize * numdims * typesize

    self.disk = Disk([filenames], [numdims], datasetsize, keys=[key])
    self.cpu_cache = Cache(self.disk, cpu_capacity, [numdims],
                           typesize = typesize, randomize=False)
dataset/ETHPy150Open nitishsrivastava/deepnet/deepnet/compute_data_stats.py/DataViewer.Load