In Tensorflow dataset api: How to use padded_batch so that a pads with a specific value without specifying the number of pads
问题 If you don't specify a padding_values then padded_batch will autopad with 0. However, if you want a different value such as -1, you can't just set padded_batch = -1 . You need to input a sequence for every slot that needs to be padded. However, I'm working with a dataset which has random values for the array lengths, so I can't really do that, since I don't know by how many numbers I'll need to pad. Since padding_values will automatically fill the rest of the value with 0, I hope there's some