tf.pad函数中有四个元组是什么意思

What does it mean when there are four tuples in a tf.pad function

我有这段代码:

    padded_inputs = tf.pad(inputs, [[0, 0], [0, 0], [pad_beg, pad_end], [pad_beg, pad_end]])

这是一张图片。我不明白为什么有四个元组,因为图像有宽度、高度和三个颜色通道。

输入数据有 4 个这样的元组 [batch_size, number_of_channels, height, width]。所以 tf.pad 没有在前两个 bc 上实现,你只需要填充图像的高度和宽度。有时,频道号也用在最后。