Improvements to util/nest.py and data/util/nest.py
authorAkshay Modi <nareshmodi@google.com>
Tue, 22 May 2018 01:53:54 +0000 (18:53 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Tue, 22 May 2018 01:56:14 +0000 (18:56 -0700)
commite4dcf28ad1c56c3a8e41ca52e7d87169eb7f93d5
treef38011097056f44ac15bc7191fb002bb12af2adb
parent1d5c44cd876377eb296cee22567228ea6f72a7ac
Improvements to util/nest.py and data/util/nest.py

Changes:
- Add a cache for type -> is_sequence to speed up Flatten/IsSequence
- Update data/util/nest.py flatten to use C Flatten

Before:
entry {
  name: "EagerLinearRegressionBenchmark.eager_train_cpu"
  iters: 2000
  wall_time: 1.91852378845
  extras {
    key: "examples_per_sec"
    value {
      double_value: 66717.9634521
    }
  }
}

After:
entry {
  name: "EagerLinearRegressionBenchmark.eager_train_cpu"
  iters: 2000
  wall_time: 1.74479198456
  extras {
    key: "examples_per_sec"
    value {
      double_value: 73361.1806638
    }
  }
}
PiperOrigin-RevId: 197497854
tensorflow/python/BUILD
tensorflow/python/data/util/nest.py
tensorflow/python/framework/sparse_tensor.py
tensorflow/python/util/util.cc
tensorflow/python/util/util.h
tensorflow/python/util/util.i