Collapse adjacent dimensions that have no paddings.
authorJingyue Wu <jingyue@google.com>
Wed, 21 Mar 2018 17:20:25 +0000 (10:20 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 21 Mar 2018 17:23:04 +0000 (10:23 -0700)
commitd854706bb3ccbcd3808ed5d89cb4b094634614ef
treec042bab265e203733bc2011ae10e362e80e12c95
parent911225a7eaf2872472484bce5f717d287a0e3224
Collapse adjacent dimensions that have no paddings.

For example,

tf.pad(<4D tensor>, [[0, 0], [0, 0], [0, 0], [0, 1]])

is equivalent to a 2D pad, which is faster.

PiperOrigin-RevId: 189926996
tensorflow/core/kernels/pad_op.cc
tensorflow/python/kernel_tests/pad_op_test.py