用tf.pad填充MNIST数据集()

用tf.pad填充MNIST数据集()

问题描述:

如何在尺寸(?,28,28,1)tf.pad()中填充MNIST数据集图像,并将其设置为(?,32,32,1)张量流?用tf.pad填充MNIST数据集()

+1

tf文档的哪个部分对您不清楚? – greeness

这取决于你打算如何填补它。举例如下:

# Assuming input is a tensor with shape (?, 28, 28, 1) 
output = tf.pad(input, [[0, 0], [2,2], [2,2], [0,0]]) 
# print(tf.shape(output)) should be (?, 32, 32, 1)