If my input is variable length and I pad it, for example:
[X, Y, Z, PAD, PAD]
And I pass to Tensorflow's RNN cell that:
sequence_length=3
Computation is stopped before the PAD symbol is evaluated, and you get a sequence of output states (one for each input):
outputs = [state1, state2, state3, state4, state5]
state4 and state5 are all zeros:
state1 = [0.123, -0.351 ...]
...
state4 = [0, 0, 0, ...]
state5 = [0, 0, 0, ...]
Is it correct that the gradient calculations of my model will not change if I do not pass the sequence_length parameter and instead manually replace state4 and state5 with zero vectors?