dgasmith / opt_einsum

⚡️Optimizing einsum functions in NumPy, Tensorflow, Dask, and more with contraction order optimization.
https://dgasmith.github.io/opt_einsum/
MIT License
848 stars 68 forks source link

Prevents double contraction of floats in dynamic path, fixes #172 #174

Closed dgasmith closed 2 years ago

dgasmith commented 2 years ago

Description

The dynamic path will find disconnected subgraphs such as aa, bc->bc and automatically contract aa-> on the fly as a pre optimization measure; however, the contraction ,bc->bc (float, matrix -> matrix) was not considered and the float is first pre contracted -> (a no-op). This PR prevents these no-ops to simplify the output path.

Status

codecov[bot] commented 2 years ago

Codecov Report

Merging #174 (94c2a11) into master (be2d3dc) will decrease coverage by 3.39%. The diff coverage is 100.00%.