testing code cannot handle a residual batch of size 1 it seems the padding code make the lengths to be 0 dims.