MCPcopy Create free account
hub / github.com/UVA-Computer-Vision-Lab/FrameINO / __init__

Method __init__

architecture/embeddings.py:2015–2028  ·  view source on GitHub ↗
(
        self,
        num_attention_heads: int,
        embed_dim: int,
        output_dim: Optional[int] = None,
    )

Source from the content-addressed store, hash-verified

2013
2014class MochiAttentionPool(nn.Module):
2015 def __init__(
2016 self,
2017 num_attention_heads: int,
2018 embed_dim: int,
2019 output_dim: Optional[int] = None,
2020 ) -> None:
2021 super().__init__()
2022
2023 self.output_dim = output_dim or embed_dim
2024 self.num_attention_heads = num_attention_heads
2025
2026 self.to_kv = nn.Linear(embed_dim, 2 * embed_dim)
2027 self.to_q = nn.Linear(embed_dim, embed_dim)
2028 self.to_out = nn.Linear(embed_dim, self.output_dim)
2029
2030 @staticmethod
2031 def pool_tokens(x: torch.Tensor, mask: torch.Tensor, *, keepdim=False) -> torch.Tensor:

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected