numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersReturns
_can_dot(inputs, result, idx_removed)

Notes

If the operations is BLAS level 1 or 2 and is not already aligned we default back to einsum as the memory movement to copy is more costly than the operation itself.

Parameters

inputs : list of str

Specifies the subscripts for summation.

result : str

Resulting summation.

idx_removed : set

Indices that are removed in the summation

Returns

type : bool

Returns true if BLAS should and can be used, else False

Checks if we can use BLAS (np.tensordot) call and its beneficial to do so.

Examples

# Standard GEMM operation >>> _can_dot(['ij', 'jk'], 'ik', set('j')) True

# Can use the standard BLAS, but requires odd data movement >>> _can_dot(['ijj', 'jk'], 'ik', set('j')) False

# DDOT where the memory is not aligned >>> _can_dot(['ijk', 'ikj'], '', set('ijk')) False

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/core/einsumfunc.py#413
type: <class 'function'>
Commit: