ndarray icon indicating copy to clipboard operation
ndarray copied to clipboard

any equivalent to np.tensordot?

Open hugolgst opened this issue 6 months ago • 3 comments

https://numpy.org/doc/2.1/reference/generated/numpy.tensordot.html

hugolgst avatar Jun 03 '25 07:06 hugolgst

I don't think we have that function. IIUC, this is not strictly related to ML so I think it would fit in ndarray.

nilgoyette avatar Jun 03 '25 12:06 nilgoyette

there's https://crates.io/crates/ndarray_einsum_beta

hugolgst avatar Jun 14 '25 07:06 hugolgst

I'm preparing a PR for this right now. I have the implementation ready and just need to focus on some tests, docs and where exactly to put the functionality.

I think in my fork I have it under linalg and impl_linalg.rs

Generally speaking I think there's probably a few more functions like tensordot and also the phase angle functionality I have in another PR.

I think they're a low hanging fruit of sorts since we have solid reference implementations (Numpy, etc) and they are mostly self contained and do not interfere with broader functionality beyond making the codebase a bit bigger and running some more tests.

But adding them provides some benefit to users who find themselves reaching for them.

jmg049 avatar Nov 08 '25 00:11 jmg049