mindspore.ops.Lerp

class mindspore.ops.Lerp[source]

Calculate the linear interpolation between two tensors based on the weight parameter.

Refer to mindspore.ops.lerp() for more details.

Supported Platforms:

Ascend GPU CPU

Examples

>>> start = Tensor(np.array([1., 2., 3., 4.]), mindspore.float32)
>>> end = Tensor(np.array([10., 10., 10., 10.]), mindspore.float32)
>>> lerp = ops.Lerp()
>>> output = lerp(start, end, 0.5)
>>> print(output)
[5.5 6. 6.5 7. ]