Thank you for your time and effort @ptrblck , I am appreciated.
I realized that the problem was being caused by the sequence creation function. I solved the issue there. Now, if I pass n_features=1 and class=2 (I was thinking that I should set this to 1 since this is binary classification, but setting 1 raises another error), the model runs without any problem.
The only problem now is that if I run the model on CPU, there is no problem, however, if I try to use GPU, I get:

RuntimeError: CUDA error: device-side assert triggered