MCPcopy
hub / github.com/hustvl/Vim / forward

Method forward

vim/rope.py:135–141  ·  view source on GitHub ↗
(self, t)

Source from the content-addressed store, hash-verified

133 print('======== shape of rope freq', self.freqs_cos.shape, '========')
134
135 def forward(self, t):
136 if t.shape[1] % 2 != 0:
137 t_spatial = t[:, 1:, :]
138 t_spatial = t_spatial * self.freqs_cos + rotate_half(t_spatial) * self.freqs_sin
139 return torch.cat((t[:, :1, :], t_spatial), dim=1)
140 else:
141 return t * self.freqs_cos + rotate_half(t) * self.freqs_sin

Callers

nothing calls this directly

Calls 2

rotate_halfFunction · 0.85
catMethod · 0.45

Tested by

no test coverage detected