tf.pad( tensor, paddings, mode='CONSTANT', name=None, constant_values=0)pad一个张量。...例如:t = tf.constant([[1, 2, 3], [4, 5, 6]])paddings = tf.constant([[1, 1,], [2, 2]])# 'constant_values...' is 0.# rank of 't' is 2.tf.pad(t, paddings, "CONSTANT") # [[0, 0, 0, 0, 0, 0, 0],...# [6, 5, 4, 5, 6, 5, 4], # [3, 2, 1, 2, 3, 2, 1]]tf.pad...CONSTANT", "REFLECT", or "SYMMETRIC".原链接: https://tensorflow.google.cn/versions/r1.9/api_docs/python/tf