Minor eager performance improvements
authorAkshay Modi <nareshmodi@google.com>
Sat, 26 May 2018 00:37:01 +0000 (17:37 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Sat, 26 May 2018 00:39:34 +0000 (17:39 -0700)
commita6eb244b2b8ee4d9592a705c4bc0771e4d708565
tree176edc290d5d069eb5b5c2413eb746225c4bc4c4
parent5ef609b6e542dc1e3f0eaf195a1f8d8d4e7ff8af
Minor eager performance improvements

- remove linear regression dependence on global step.
  This speeds things up a lot for the benchmark (since it removes a bunch of
  unnecessary code), but is obviously not a fair comparison.
  I think its worth doing, since I don't see any reason to have a global step
  in eager.

- nn_ops dropout had an unnecessary convert_to_tensor, convert back to numpy
  (with a GPU this would copy out, copy back).
- cudnn_recurrent reshape would always fallback to the slow path - so I just
  converted it to be in the fastpath - this will be low impact.

- tensor_shape should not generate a new object every time
- remove unnecessary list creation and searching in some dtypes functions

PiperOrigin-RevId: 198127757
tensorflow/contrib/eager/python/examples/linear_regression/linear_regression.py
tensorflow/python/framework/dtypes.py
tensorflow/python/framework/tensor_shape.py
tensorflow/python/keras/layers/cudnn_recurrent.py
tensorflow/python/ops/nn_ops.py