Class ov::pass::DeReshapeFullyConnected#

class DeReshapeFullyConnected : public ov::pass::MatcherPass#

Transformation uses symbol information to optimize out Reshape operations surrounding special cases of MatMul. It checks that surrounding Reshapes are only manipulating with batch dimensions of tensor in a do-undo kind of way. The difference with previous optimization is that this case has Reshape only on one input of MatMul and the other input is strictly 2D. Such MatMuls are also called FullyConnected.

Example: Before: [A,B,4096] -> Reshape -> [A*B,4096] MatMul [A*B,4608] -> Reshape -> [A,B,4608] [4096,4608]

After: [A,B,4096] -> MatMul -> [A,B,4608] [4096,4608] ->