array-api icon indicating copy to clipboard operation
array-api copied to clipboard

Should vecdot broadcast along the contracted axis?

Open asmeurer opened this issue 1 year ago • 1 comments

The spec implies that it should https://data-apis.org/array-api/latest/API_specification/generated/signatures.linear_algebra_functions.vecdot.html#signatures.linear_algebra_functions.vecdot. However, other functions like matmul do not contract along the contracted axis.

This came up in the numpy implementation, which is currently wrong, but is being fixed at https://github.com/numpy/numpy/pull/21928.

asmeurer avatar Aug 04 '22 17:08 asmeurer

tensordot does not allow broadcasting in the contracted axes, so I think vecdot shouldn't, either.

leofang avatar Aug 05 '22 00:08 leofang