cunumeric.einsum#

cunumeric.einsum(expr, *operands, out=None, optimize=False)#

Evaluates the Einstein summation convention on the operands.

Using the Einstein summation convention, many common multi-dimensional, linear algebraic array operations can be represented in a simple fashion. In implicit mode einsum computes these values.

In explicit mode, einsum provides further flexibility to compute other array operations that might not be considered classical Einstein summation operations, by disabling, or forcing summation over specified subscript labels.

Parameters
  • subscripts (str) – Specifies the subscripts for summation as comma separated list of subscript labels. An implicit (classical Einstein summation) calculation is performed unless the explicit indicator ‘->’ is included as well as subscript labels of the precise output form.

  • operands (list[array_like]) – These are the arrays for the operation.

  • out (ndarray, optional) – If provided, the calculation is done into this array.

  • optimize ({False, True, 'greedy', 'optimal'}, optional) – Controls if intermediate optimization should occur. No optimization will occur if False. Uses opt_einsum to find an optimized contraction plan if True.

Returns

output – The calculation based on the Einstein summation convention.

Return type

ndarray

Notes

For most expressions, only floating-point types are supported.

See also

numpy.einsum

Availability

Multiple GPUs, Multiple CPUs