As @albanD suggested, issue is with accessing element out of bound.
Simple approach to debug is add

print(input.shape)

before calling classifier.
My guess is make_batch is increasing sequence length