Make tf.clip_by_value not crash on empty tensors
authorGeoffrey Irving <irving@naml.us>
Wed, 16 May 2018 22:47:58 +0000 (15:47 -0700)
committerGeoffrey Irving <irving@naml.us>
Wed, 16 May 2018 22:47:58 +0000 (15:47 -0700)
commitce11f0b65d3e4d0bf2b03f5956cb34cb3d96ad89
tree917e448c8ce18d4ba843042a1723813c0ad26219
parent51ef16057b4625e0a3e2943a9f1bbf856cf098ca
Make tf.clip_by_value not crash on empty tensors

Also rearrange the code to remove duplication.  No tests yet; I'll leave
refactoring the test cases for empty tensor coverage to someone else.

Fixes #19337.
tensorflow/core/kernels/cwise_op_clip.cc