(q)
| 14 | |
| 15 | # PyTorch-backed implementations |
| 16 | def qinv(q): |
| 17 | assert q.shape[-1] == 4, 'q must be a tensor of shape (*, 4)' |
| 18 | mask = torch.ones_like(q) |
| 19 | mask[..., 1:] = -mask[..., 1:] |
| 20 | return q * mask |
| 21 | |
| 22 | |
| 23 | def qinv_np(q): |
no outgoing calls
no test coverage detected