def prepare_batches(self):
        """Prepare batches by splitting input list into chunks of batch_size.

        Data won't be copied to batch directory until get_batch is called.
        """
        if self.batch_size is None:
            self.num_batches = 1
            return

        # create temporary directory for batch processing
        self.batch_tmp_dir = tempfile.TemporaryDirectory("olive_tmp_")  # pylint: disable=consider-using-with
        # directory to save batch data
        self.batch_dir = Path(self.batch_tmp_dir.name) / "batch"

        # create batch input list replacing self.data_dir with self.batch_dir
        # batch data will be moved to self.batch_dir when get_batch is called
        batch_input_list = input_list_utils.resolve_input_list(
            self.batch_dir, self.input_list, self.batch_tmp_dir.name, self.data_dir, "batch_input_list.txt"
        )

        self.batch_input_list_headers = []
        self.batch_input_list_contents = []
        with open(self.input_list) as f, open(batch_input_list) as f_batch:
            for line, line_batch in zip(f, f_batch):
                if line.startswith(("#", "%")):
                    self.batch_input_list_headers.append(line.strip())
                else:
                    self.batch_input_list_contents.append((line.strip(), line_batch.strip()))

        self.batch_input_list_metadata = []
        for line, line_batch in self.batch_input_list_contents:
            to_copy = []
            for input_str, input_batch in zip(line.split(), line_batch.split()):
                if ":=" in input_str:
                    to_copy.append((input_str.split(":=")[1], input_batch.split(":=")[1]))
                else:
                    to_copy.append((input_str, input_batch))
            self.batch_input_list_metadata.append((line_batch, to_copy))

        self.batches = []
        for i in range(0, len(self.batch_input_list_metadata), self.batch_size):
            self.batches.append(self.batch_input_list_metadata[i : i + self.batch_size])
        self.num_batches = len(self.batches)
Prepare batches by splitting input list into chunks of batch_size.

        Data won't be copied to batch directory until get_batch is called.
        
olive/platform_sdk/qualcomm/utils/data_loader.py