Collapse adjacent dimensions that have no paddings.
authorJingyue Wu <jingyue@google.com>
Fri, 9 Mar 2018 06:05:27 +0000 (22:05 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Fri, 9 Mar 2018 06:09:13 +0000 (22:09 -0800)
commit7dbe0cf7ecc4d0560ec9081b443ada693e4e6096
tree347fe2057b9850bb860c91ee0d97bd08dcdad133
parent45ef823633f2f1edd67a1fe02efb97e7014f4fee
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: 188440916
tensorflow/core/kernels/pad_op.cc
tensorflow/python/kernel_tests/pad_op_test.py