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

Method forward

vtp/models/layers/block.py:300–308  ·  view source on GitHub ↗
(self, x_or_x_list, rope_or_rope_list=None, drop_ratio: Optional[float] = None)

Source from the content-addressed store, hash-verified

298 return x_ffn
299
300 def forward(self, x_or_x_list, rope_or_rope_list=None, drop_ratio: Optional[float] = None) -> List[Tensor]:
301 if isinstance(x_or_x_list, Tensor):
302 return self._forward_list([x_or_x_list], rope_list=[rope_or_rope_list], drop_ratio=drop_ratio)[0]
303 elif isinstance(x_or_x_list, list):
304 if rope_or_rope_list is None:
305 rope_or_rope_list = [None for x in x_or_x_list]
306 return self._forward_list(x_or_x_list, rope_list=rope_or_rope_list, drop_ratio=drop_ratio)
307 else:
308 raise AssertionError
309
310
311class CausalSelfAttentionBlock(nn.Module):

Callers

nothing calls this directly

Calls 1

_forward_listMethod · 0.95

Tested by

no test coverage detected