Fix bug and speed up Grappler constant folding
authorRasmus Munk Larsen <rmlarsen@google.com>
Wed, 7 Feb 2018 20:56:06 +0000 (12:56 -0800)
committerGitHub <noreply@github.com>
Wed, 7 Feb 2018 20:56:06 +0000 (12:56 -0800)
commit1893d25a795e29d276ae3484cfe0727eb657e4ad
tree7b5189190e5629d136d3430e5879e4495038f6e3
parent42ce11f3a24133448def0c571e11cff4bd4f9b38
Fix bug and speed up Grappler constant folding

Fix bug in and speed up ConstantFolding::CreateNodeDef():
  * Fix bug trying to store more than kintmax32 values in a repeated proto field.
  * Speed up populating compressed format. Example: tensorflow/python/kernel_tests/large_concat_op_test with size = 2**29+6 goes from ~30 seconds to ~15 seconds. The fraction of time spent in ConstantFolding::CreateNodeDef() goes down from about 35% to about 12%.
tensorflow/core/grappler/optimizers/constant_folding.cc