fn
lerp
→Tensorlerp(input: Tensor)Linearly interpolate between input and an endpoint with a weight.
Computes the affine combination
where is the interpolation weight. weight may be a
scalar or a tensor broadcastable to input.
Parameters
inputTensorStart point.
Returns
TensorInterpolated tensor of the broadcast shape.
Notes
With w = 0 the result equals input; with w = 1 it equals
end; out-of-range weights extrapolate beyond the endpoints.
Examples
>>> import lucid
>>> a = lucid.tensor([0.0, 0.0, 0.0])
>>> b = lucid.tensor([1.0, 2.0, 4.0])
>>> lucid.lerp(a, b, 0.5)
Tensor([0.5, 1. , 2. ])