Commit f31c1acd authored by A. Unique TensorFlower's avatar A. Unique TensorFlower Committed by TensorFlower Gardener
Browse files

Fix a bug in the associative & commutative rewrite in constant folding:

I finally tracked it down to the case where we do the transformation:

    //
    //                      +                +       = parent
    //                     / \              / \
    //                    C   +    -- >    X   +     = children
    //                       / \              / \
    //                      X   Y            C   Y   = leaves

when there exists a control dependency from the child '+' to C. This control dependency creates a cycle in the graph when X and C are simply swapped. We can fix it by moving the control dependency and anchoring it on Y instead (We still need it in case we are inside a frame).

PiperOrigin-RevId: 182705910
parent c2f75aea
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment