# tfg.math.interpolation.slerp.interpolate_with_weights

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/math/interpolation/slerp.py#L116-L146) |

Interpolates vectors by taking their weighted sum.

    tfg.math.interpolation.slerp.interpolate_with_weights(
        vector1: type_alias.TensorLike,
        vector2: type_alias.TensorLike,
        weight1: Union[type_alias.Float, type_alias.TensorLike],
        weight2: Union[type_alias.Float, type_alias.TensorLike],
        name: str = 'interpolate_with_weights'
    ) -> tf.Tensor

Interpolation for all variants of slerp is a simple weighted sum over inputs.
Therefore this function simply returns weight1 \* vector1 + weight2 \* vector2.

<br />

<br />

<br />

| ## Note ||
|---|---|
| In the following, A1 to An are optional batch dimensions. ||

<br />

<br />

<br />

<br />

| ## Args ||
|---|---|
| `vector1` | A tensor of shape `[A1, ... , An, M]`, which stores a normalized vector in its last dimension. |
| `vector2` | A tensor of shape `[A1, ... , An, M]`, which stores a normalized vector in its last dimension. |
| `weight1` | A `float` or a tensor describing weights for the `vector1` and with a shape broadcastable to the shape of the input vectors. |
| `weight2` | A `float` or a tensor describing weights for the `vector2` and with a shape broadcastable to the shape of the input vectors. |
| `name` | A name for this op. Defaults to "interpolate_with_weights". |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor of shape `[A1, ... , An, M]` containing the result of the interpolation. ||

<br />