MCPcopy Create free account
hub / github.com/Bairong-Xdynamics/MistakeNotebookLearning / batch_data

Function batch_data

mnl/utils.py:222–236  ·  view source on GitHub ↗

Split data into batches. Args: data: List of data items batch_size: Size of each batch Returns: List of batches

(data: List[Any], batch_size: int)

Source from the content-addressed store, hash-verified

220
221
222def batch_data(data: List[Any], batch_size: int) -> List[List[Any]]:
223 """
224 Split data into batches.
225
226 Args:
227 data: List of data items
228 batch_size: Size of each batch
229
230 Returns:
231 List of batches
232 """
233 batches = []
234 for i in range(0, len(data), batch_size):
235 batches.append(data[i:i + batch_size])
236 return batches
237

Callers 2

_evaluate_on_eval_setMethod · 0.85
trainMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected