MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / make_batch

Function make_batch

examples/xpu/benchmark_paged_memory.py:67–71  ·  view source on GitHub ↗

Create a random batch of input_ids and labels.

(args)

Source from the content-addressed store, hash-verified

65
66
67def make_batch(args):
68 """Create a random batch of input_ids and labels."""
69 input_ids = torch.randint(0, args.vocab_size, (args.batch_size, args.seq_len), device=args.device)
70 labels = input_ids.clone()
71 return input_ids, labels
72
73
74def cleanup(device_type):

Callers 1

measure_trainingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected