MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / rotate_half

Function rotate_half

sat/dit_video_concat.py:260–264  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

258
259
260def rotate_half(x):
261 x = rearrange(x, "... (d r) -> ... d r", r=2)
262 x1, x2 = x.unbind(dim=-1)
263 x = torch.stack((-x2, x1), dim=-1)
264 return rearrange(x, "... d r -> ... (d r)")
265
266
267class Rotary3DPositionEmbeddingMixin(BaseMixin):

Callers 1

rotaryMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected