MCPcopy Create free account
hub / github.com/Standard-Intelligence/hertz-dev / forward

Method forward

transformer.py:224–232  ·  view source on GitHub ↗

x: (B, S, D) kv: (B, S, H, D)

(self,
            x: Tensor,
            kv: Optional[Tensor] = None,)

Source from the content-addressed store, hash-verified

222 return q, k, v
223
224 def forward(self,
225 x: Tensor,
226 kv: Optional[Tensor] = None,):
227 """
228 x: (B, S, D)
229 kv: (B, S, H, D)
230 """
231 q, k, v = self._project(x)
232 return self._attend(q, k, v, kv_cache=kv)
233
234
235class PreNormAttn(nn.Module):

Callers

nothing calls this directly

Calls 2

_projectMethod · 0.95
_attendMethod · 0.95

Tested by

no test coverage detected