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

In all constant-propagation transformations, check that the array we'd be...

In all constant-propagation transformations, check that the array we'd be turning into a constant is a
discardable array. If it's not discardable, it means that the user wants this array to keep existing
in a way that is observable to them, i.e. not as weights.

Typical example: a Fill op outputs an array that is passed as a RNN state array (non-discardable).
It seems that so far we have been relying on accidental ordering of graph transformations for such state
arrays not to be accidentally turned into constants. Instead, the desired graph transformation here is
RemoveUnusedOp noticing that such a Fill can be discarded since its output is a RNN state array.

So I don't have a test for this, but this seems to be tightening existing behavior, and should be good
to have as long as it does not regress anything.

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