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

Function gdn_gates

deepspeed/module_inject/kernel_reference.py:43–47  ·  view source on GitHub ↗

GDN gating: beta = sigmoid(b), g = -exp(a_log) * softplus(a + dt_bias).

(a, b, a_log, dt_bias)

Source from the content-addressed store, hash-verified

41
42
43def gdn_gates(a, b, a_log, dt_bias):
44 """GDN gating: beta = sigmoid(b), g = -exp(a_log) * softplus(a + dt_bias)."""
45 beta = torch.sigmoid(b)
46 g = -torch.exp(a_log.float()) * F.softplus(a.float() + dt_bias.float())
47 return beta, g.to(b.dtype)
48
49
50def decode_attn(q, K, V, pos):

Callers

nothing calls this directly

Calls 1

toMethod · 0.45

Tested by

no test coverage detected