Created
April 13, 2020 08:10
-
-
Save alonstern/ef8cc1f961d12098f607d57c0c4e461d to your computer and use it in GitHub Desktop.
split to block without padding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _split_to_blocks(self, data, tags, block_size): | |
data_blocks = [] | |
tags_blocks = [] | |
for file_data, file_tags in zip(data, tags): | |
for start_index in range(0, len(file_data), block_size): | |
data_blocks.append(file_data[start_index: start_index + block_size]) | |
tags_blocks.append(file_tags[start_index: start_index + block_size]) | |
return data_blocks, tags_blocks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment