MCPcopy Create free account
hub / github.com/MiniMax-AI/VTP / forward

Method forward

vtp/models/layers/attention.py:91–96  ·  view source on GitHub ↗
(self, x: Tensor, attn_bias=None, rope: Tensor = None)

Source from the content-addressed store, hash-verified

89 return q, k
90
91 def forward(self, x: Tensor, attn_bias=None, rope: Tensor = None) -> Tensor:
92 qkv = self.qkv(x)
93 attn_v = self.compute_attention(qkv=qkv, attn_bias=attn_bias, rope=rope)
94 x = self.proj(attn_v)
95 x = self.proj_drop(x)
96 return x
97
98 def forward_list(self, x_list, attn_bias=None, rope_list=None) -> List[Tensor]:
99 assert len(x_list) == len(rope_list) # should be enforced by the Block

Callers

nothing calls this directly

Calls 1

compute_attentionMethod · 0.95

Tested by

no test coverage detected