MCPcopy Create free account
hub / github.com/MotrixLab/FineMoGen / qinv

Function qinv

mogen/datasets/pipelines/quaternion.py:18–22  ·  view source on GitHub ↗
(q)

Source from the content-addressed store, hash-verified

16
17
18def qinv(q):
19 assert q.shape[-1] == 4, 'q must be a tensor of shape (*, 4)'
20 mask = torch.ones_like(q)
21 mask[..., 1:] = -mask[..., 1:]
22 return q * mask
23
24
25def qinv_np(q):

Callers 2

qinv_npFunction · 0.70
qslerpFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected