(p0, p1, t)
| 410 | |
| 411 | |
| 412 | def 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) |
nothing calls this directly
no outgoing calls
no test coverage detected