Improvements to quantization matching code:
authorSuharsh Sivakumar <suharshs@google.com>
Fri, 23 Mar 2018 03:40:55 +0000 (20:40 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Fri, 23 Mar 2018 03:43:01 +0000 (20:43 -0700)
commit72f48771ea4fce68af893bcda862ca390a0e6b70
treeb970158c7b0a7c1a151892d5c331ab6ecac70c3d
parent1c3b7c3639b2d2f694d1b28acbd05daaa6064311
Improvements to quantization matching code:

- Guarantee that we do the largest matches first.
- Don't allow matching layers multiple times.
- Don't allow adding quantization ops to the same node multiple times.
- Return a list of match results rather than yielding. This is much easier to reason about.
- Only require ReadVariableOp when matching resource variables, since the input to ReadVariableOps don't necessarily have to be a VarHandleOp.
- Place post activation bypass ops quantization nodes in the same post activation bypass op's name scope for better viewing.

PiperOrigin-RevId: 190169622
tensorflow/contrib/quantize/python/graph_matcher.py
tensorflow/contrib/quantize/python/quantize.py
tensorflow/contrib/quantize/python/quantize_test.py