MCPcopy Create free account
hub / github.com/InternLM/InternBootcamp / split

Method split

verl/verl/protocol.py:916–925  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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":

Callers 15

check_hardwareFunction · 0.45
check_networkFunction · 0.45
_get_gpu_infoFunction · 0.45
highlight_keywordFunction · 0.45
save_lora_adapterMethod · 0.45
_merge_across_tpMethod · 0.45
_merge_state_dictsMethod · 0.45
get_changed_linesFunction · 0.45
extract_reward_from_lineFunction · 0.45

Calls

no outgoing calls

Tested by 4

generate_imageMethod · 0.36