MCPcopy Create free account
hub / github.com/kyegomez/BitNet / __init__

Method __init__

bitnet/bit_moe.py:93–97  ·  view source on GitHub ↗
(self, dim: int, num_experts: int, top_k: int = 2)

Source from the content-addressed store, hash-verified

91 """
92
93 def __init__(self, dim: int, num_experts: int, top_k: int = 2):
94 super(BitMoE, self).__init__()
95 self.router = NoisyTopkRouter(dim, num_experts, top_k)
96 self.experts = nn.ModuleList([Expert(dim) for _ in range(num_experts)])
97 self.top_k = top_k
98
99 def forward(self, x):
100 gating_output, indices = self.router(x)

Callers

nothing calls this directly

Calls 3

NoisyTopkRouterClass · 0.85
ExpertClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected