pytensor icon indicating copy to clipboard operation
pytensor copied to clipboard

Add numpy `multi_dot` helper and graph rewrites

Open ricardoV94 opened this issue 1 year ago • 0 comments

Description

https://numpy.org/doc/stable/reference/generated/numpy.linalg.multi_dot.html#

The helper should just use pytensor dot/ matmul under the hood while matching the call signature of numpy.

The fun part is to add a graph rewriter that identifies sequences of dot products and reorders them based on available static shape information so as to reduce number of operations needed

https://en.m.wikipedia.org/wiki/Matrix_chain_multiplication

ricardoV94 avatar Jan 11 '24 00:01 ricardoV94