<p>I think you may use <a href="https://arxiv.org/abs/1409.0473" rel="nofollow noreferrer">attention mechanism</a> to convert the variable-length inputs to some fixed length tensor before you feed them into a feed forward network. </p>
how to deal with padded 0 during feedforward process
<p>Assume I have a lists of inputs of different sizes, for example, some are of the shape[10,9,5] some are [7,6,5], I have to pad 0s to feed them into tensor flow with the same size, say [10,9,5], I need to do matrix multiplication and add the biases during the forward process which will introduce numbers in the padded 0 positions. So I have to create a mask matrix by myself to mask them? Or is there an easier way from tensorflow? Thanks!</p>

<p>BTW, I'm not feeding sequences nor using rnn. so I cannot use dynamic rnn</p>