Hi @ptrblck,
I’ve found error was on my batch_size function and its internal logic. I was making batches of words given text as
batch_data(words, sequence_length, batch_size)
I was given a problem to Implement the  batch_data  function to batch  words  data into chunks of size  batch_size  using the  TensorDataset  and  DataLoader  classes
My illogical code was
def batch_data(words, sequence_length, batch_size):
    batch_size_total = batch_size * sequence_length
    n_batches = len(words) // batch_size_total
    words = words[:n_batches*batch_size_total]
    x = np.arange(len(words)).reshape(batch_size,sequence_length)
    y = x.T[-1] + 1
    feature_tensors = torch.from_numpy(x)
    target_tensors =   torch.from_numpy(y)

    data = TensorDataset(feature_tensors, target_tensors)
    data_loader = torch.utils.data.DataLoader(data,  batch_size=batch_size, shuffle=True)
    return data_loader

I’m trying to solving the problem. Thanks and appretitate for you support  .
edit:
I think i have solved it . I had to change the  x values.