Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.vecdot

Contents

jax.numpy.vecdot#

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

Perform a conjugate multiplication of two batched vectors.

JAX implementation ofnumpy.vecdot().

Parameters:
  • a – left-hand side array.

  • b – right-hand side array. Size ofb[axis] must match size ofa[axis],and remaining dimensions must be broadcast-compatible.

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

  • precision (None |str |Precision |tuple[str,str]|tuple[Precision,Precision]|DotAlgorithm |DotAlgorithmPreset) – 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 ofa andb.

  • preferred_element_type (str |type[Any]|dtype |SupportsDType |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.

  • x1 (Array |ndarray |bool |number |bool |int |float |complex |TypedNdArray)

  • x2 (Array |ndarray |bool |number |bool |int |float |complex |TypedNdArray)

Returns:

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

Return type:

Array

See also

Examples

Vector conjugate-dot product of two 1D arrays:

>>>a=jnp.array([1j,2j,3j])>>>b=jnp.array([4.,5.,6.])>>>jnp.linalg.vecdot(a,b)Array(0.-32.j, dtype=complex64)

Batched vector dot product of two 2D arrays:

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

[8]ページ先頭

©2009-2025 Movatter.jp