MCPcopy Create free account
hub / github.com/Seunggu0305/VLCounter / forward

Method forward

tools/models/Text_Encoder.py:77–86  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

75 return mask
76
77 def forward(self, text):
78 x = self.token_embedding(text)
79 x = x + self.positional_embedding
80 x = x.permute(1, 0, 2)
81 x = self.transformer(x)
82 x = x.permute(1, 0, 2)
83 x = self.ln_final(x)
84 x = x[torch.arange(x.shape[0]), text.argmax(dim=-1)] @ self.text_projection
85 # x = self.text_projection(x[torch.arange(x.shape[0]), text.argmax(dim=-1)])
86 return x

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected