Macro Einsum for ndarray
Setup
Install python
and the opt_einsum
package.
Usage
The syntax is similar to numpy
's. For each input argument, use (expr).(axes)
.
Then use a fat arrow =>
, and for the output axes use .(axes)
and a semicolon ;
.
After the semicolon, you need to pass the dimensions of each of the axes in order for the
macro to optimize the path at compiletime. See example below
Example
let y: = einsum!;