Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.linalg.vecdot

Contents

jax.numpy.linalg.vecdot#

jax.numpy.linalg.vecdot(x1,x2,/,*,axis=-1,precision=None,preferred_element_type=None)[source]#

Compute the (batched) vector conjugate dot product of two arrays.

JAX implementation ofnumpy.linalg.vecdot().

Parameters:
  • x1 (ArrayLike) – left-hand side array.

  • x2 (ArrayLike) – right-hand side array. Size ofx2[axis] must match size ofx1[axis],and remaining dimensions must be broadcast-compatible.

  • axis (int) – axis along which to compute the dot product (default: -1)

  • precision (lax.PrecisionLike) – eitherNone (default), which means the default precision forthe backend, aPrecision enum value (Precision.DEFAULT,Precision.HIGH orPrecision.HIGHEST) or a tuple of twosuch values indicating precision ofx1 andx2.

  • preferred_element_type (DTypeLike |None) – eitherNone (default), which means the defaultaccumulation type for the input types, or a datatype, indicating toaccumulate results to and return a result with that datatype.

Returns:

array containing the conjugate dot product ofx1 andx2 alongaxis.The non-contracted dimensions are broadcast together.

Return type:

Array

See also

Examples

Vector dot product of two 1D arrays:

>>>x1=jnp.array([1,2,3])>>>x2=jnp.array([4,5,6])>>>jnp.linalg.vecdot(x1,x2)Array(32, dtype=int32)

Batched vector dot product of two 2D arrays:

>>>x1=jnp.array([[1,2,3],...[4,5,6]])>>>x2=jnp.array([[2,3,4]])>>>jnp.linalg.vecdot(x1,x2,axis=-1)Array([20, 47], dtype=int32)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp