Split the batch among dim=0 into chunks. The meta_info is passed to each DataProto after split. Args: split_size (int): the size of each split Returns: List[DataProto]: a list of DataProto after splitting
(self, split_size: int)
| 914 | return output |
| 915 | |
| 916 | def split(self, split_size: int) -> list["DataProto"]: |
| 917 | """Split the batch among dim=0 into chunks. The meta_info is passed to each DataProto after split. |
| 918 | |
| 919 | Args: |
| 920 | split_size (int): the size of each split |
| 921 | |
| 922 | Returns: |
| 923 | List[DataProto]: a list of DataProto after splitting |
| 924 | """ |
| 925 | return [self[i : i + split_size] for i in range(0, len(self), split_size)] |
| 926 | |
| 927 | @staticmethod |
| 928 | def concat(data: list["DataProto"]) -> "DataProto": |
no outgoing calls