Skip to main content

vecdot

Function vecdot 

Source
pub fn vecdot(
    lhs: impl AsRef<Array>,
    rhs: impl AsRef<Array>,
    axis: i32,
) -> Result<Array>
Expand description

Compute a vector dot product along axis.

The first operand is conjugated, the remaining dimensions are broadcast, and the selected axis is reduced. Unequal-rank axis normalization is not part of this API’s contract.

use mlx_rs::{array, ops::vecdot};

let result = vecdot(array!([1.0, 2.0]), array!([3.0, 4.0]), -1).unwrap();
assert!(result.shape().is_empty());