Skip to content

daft.functions.dot_product#

dot_product #

dot_product(left: Expression, right: Expression) -> Expression

Compute the dot product between two embeddings.

Parameters:

Name Type Description Default
left FixedSizeList or Embedding Expression

The left vector

required
right FixedSizeList or Embedding Expression

The right vector

required

Returns:

Name Type Description
Expression Float64 Expression

the dot product between the two vectors.

Source code in daft/functions/distance.py
42
43
44
45
46
47
48
49
50
51
52
def dot_product(left: Expression, right: Expression) -> Expression:
    """Compute the dot product between two embeddings.

    Args:
        left (FixedSizeList or Embedding Expression): The left vector
        right (FixedSizeList or Embedding Expression): The right vector

    Returns:
        Expression (Float64 Expression): the dot product between the two vectors.
    """
    return Expression._call_builtin_scalar_fn("dot_product", left, right)