MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / _inputs

Function _inputs

tests/unit/runtime/zero/test_zero_shared_loss_gradient.py:54–56  ·  view source on GitHub ↗
(device, rank, micro_step)

Source from the content-addressed store, hash-verified

52
53
54def _inputs(device, rank, micro_step):
55 values = torch.arange(8, device=device, dtype=torch.float32).reshape(2, 4)
56 return (values + rank * 3 + micro_step).to(torch.bfloat16)
57
58
59def _make_engine(model, gradient_accumulation_steps):

Calls 2

reshapeMethod · 0.45
toMethod · 0.45

Tested by

no test coverage detected