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

Method __init__

tests/unit/runtime/zero/test_autoep_zero3_init.py:21–27  ·  view source on GitHub ↗
(self, layer_index)

Source from the content-addressed store, hash-verified

19class _Experts(nn.Module):
20
21 def __init__(self, layer_index):
22 super().__init__()
23 self.w1 = nn.Parameter(torch.full((2, 2), float(layer_index + 1)))
24 self.w2 = nn.Parameter(torch.full((2, 2), float(layer_index + 2)), requires_grad=False)
25 for param in self.parameters():
26 param.ds_zero_placement_family = "autoep_expert"
27 param.ds_zero_partition_group_name = f"expert_group_{layer_index}"
28
29
30class _Replacement(nn.Module):

Callers 1

__init__Method · 0.45

Calls 2

fullMethod · 0.80
parametersMethod · 0.45

Tested by

no test coverage detected