Skip to Content

This page lists 4 functions in the spql.tensor namespace generated from the default SPQL function catalog.

FunctionKindSummary
spql.tensor.cosine_similarityscalar functionCompute the row-wise cosine similarity between two vectors.
spql.tensor.inner_productscalar functionCompute the row-wise inner product between two vectors.
spql.tensor.l2_denormscalar functionRe-apply row-wise L2 norms to normalized tensor values.
spql.tensor.l2_normscalar functionCompute the row-wise Euclidean norm of a vector.

spql.tensor.cosine_similarity

Kind: scalar function

This function has multiple public overloads.

spql.tensor.cosine_similarity(lhs, rhs)

Compute the row-wise cosine similarity between two vectors.

Parameters

NameRequiredDescription
lhsyesLeft tensor-like value.
rhsyesRight tensor-like value.

Returns

A float scalar value.

spql.tensor.cosine_similarity(lhs, rhs)

Compute the row-wise cosine similarity between two static tensors.

Parameters

NameRequiredDescription
lhsyesLeft tensor-like value.
rhsyesRight tensor-like value.

Returns

A float scalar value.

spql.tensor.inner_product

Kind: scalar function

This function has multiple public overloads.

spql.tensor.inner_product(lhs, rhs)

Compute the row-wise inner product between two vectors.

Parameters

NameRequiredDescription
lhsyesLeft tensor-like value.
rhsyesRight tensor-like value.

Returns

A float scalar value.

spql.tensor.inner_product(lhs, rhs)

Compute the row-wise Frobenius inner product between two static tensors.

Parameters

NameRequiredDescription
lhsyesLeft tensor-like value.
rhsyesRight tensor-like value.

Returns

A float scalar value.

spql.tensor.l2_denorm

Kind: scalar function

Re-apply row-wise L2 norms to normalized tensor values.

Signature

spql.tensor.l2_denorm(normalized, norms)

Parameters

NameRequiredDescription
normalizedyesRow-wise L2-normalized tensor-like value.
normsyesAuthoritative row-wise L2 norms.

spql.tensor.l2_norm

Kind: scalar function

This function has multiple public overloads.

spql.tensor.l2_norm(value)

Compute the row-wise Euclidean norm of a vector.

Parameters

NameRequiredDescription
valueyesTensor-like value.

Returns

A float scalar value.

spql.tensor.l2_norm(value)

Compute the row-wise Euclidean norm of a static tensor.

Parameters

NameRequiredDescription
valueyesTensor-like value.

Returns

A float scalar value.

Last updated on