okay, have you tried setting include_lengths=True while declaring Text Field, which will give length of actual sentence.
With this batch.text wil return text and text length, pass these two values into forward method.Hope this helps