MCPcopy
hub / github.com/FedML-AI/FedML / combine_batches

Function combine_batches

python/app/fednlp/span_extraction/data/data_loader.py:22–28  ·  view source on GitHub ↗
(batches)

Source from the content-addressed store, hash-verified

20
21
22def combine_batches(batches):
23 full_x = torch.from_numpy(np.asarray([])).float()
24 full_y = torch.from_numpy(np.asarray([])).long()
25 for (batched_x, batched_y) in batches:
26 full_x = torch.cat((full_x, batched_x), 0)
27 full_y = torch.cat((full_y, batched_y), 0)
28 return [(full_x, full_y)]
29
30
31def load_synthetic_data(args):

Callers 1

load_synthetic_dataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected