MCPcopy Create free account
hub / github.com/MotrixLab/MotionDiffuse / lerp

Function lerp

text2motion/utils/quaternion.py:412–423  ·  view source on GitHub ↗
(p0, p1, t)

Source from the content-addressed store, hash-verified

410
411
412def lerp(p0, p1, t):
413 if not isinstance(t, torch.Tensor):
414 t = torch.Tensor([t])
415
416 new_shape = t.shape + p0.shape
417 new_view_t = t.shape + torch.Size([1] * len(p0.shape))
418 new_view_p = torch.Size([1] * len(t.shape)) + p0.shape
419 p0 = p0.view(new_view_p).expand(new_shape)
420 p1 = p1.view(new_view_p).expand(new_shape)
421 t = t.view(new_view_t).expand(new_shape)
422
423 return p0 + t * (p1 - p0)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected