def _gen_partition(self, wlkey='BASE', dnkey='BASE', optkey='BASE',
                    guaranteed=False):
     ''' Generate PartitionScheme. '''
     for part in partition.gen_partition(self.layers[wlkey],
                                         self.batch_size,
                                         self.dim_nodes[dnkey],
                                         self.options[optkey],
                                         guaranteed=guaranteed):
         yield part
    def _gen_all_partition(self, layerkey='PAR'):
        '''
        Generate PartitionScheme.
        '''
        options = Option(partition_hybrid=True,
                         partition_batch=True,
                         partition_ifmaps=True,
                         ntops=2**30)

        for part in partition.gen_partition(
                self.layer[layerkey], self.batch_size,
                self.resource['PAR'].proc_region.dim, options):
            yield part