torch.EinsumOptions
export interface EinsumOptions {
/**
* Optimization strategy for contraction order.
* - `false` (default): Use left-to-right order
* - `true`: Auto-select (optimal for ≤6 operands, greedy otherwise)
* - `'greedy'`: Fast O(n²) algorithm, good but not always optimal
* - `'optimal'`: DP algorithm, finds minimum FLOP order (exponential in operands)
*/
optimize?: boolean | 'greedy' | 'optimal';
}optimize(boolean | 'greedy' | 'optimal')optional- – Optimization strategy for contraction order. -
false(default): Use left-to-right order -true: Auto-select (optimal for ≤6 operands, greedy otherwise) -'greedy': Fast O(n²) algorithm, good but not always optimal -'optimal': DP algorithm, finds minimum FLOP order (exponential in operands)
Options for einsum operations