oh my… you are my savior.
here is the code… but dont laugh.
this is the train function.
def train(target, label):
    hidden = model.init_hidden(batch_size, device)
    output = 0
    loss = 0

    for i in range(len(target)):
        optimizer.zero_grad()
        output, hidden = model(target[i], hidden)
        loss = criterion(output, label[i].argmax(1)).to(device)
        loss.backward(retain_graph=True)
        optimizer.step()

        for j in range(0, batch_size):
            sys.stdout.write("batch " + str(j + 1) + " : ")
            for k in range(0, seq_len):
                expected = torch.argmax(target[i][k][j])
                sys.stdout.write(idx_to_word[expected.item()] + " ")

            sys.stdout.write(" -> ")
            for k in range(0, seq_len):
                expected = torch.argmax(output[k][j])
                sys.stdout.write(idx_to_word[expected.item()] + " ")
            sys.stdout.write("\n")
        sys.stdout.write("\n")

    return output, loss.item()

this is where repeats training.
for iter in range(1, n_iter + 1):
    now_epoch = 0

    while now_epoch + batch_size <= len(data):
        target = make_batch(data[now_epoch:now_epoch + batch_size])

        label = target[1:len(target)] + [torch.zeros(seq_len, batch_size, input_size)]

        output, loss = train(target, label)

        if iter % print_every == 0:
            sys.stdout.write("%d %d%% (%s) %.4f" % (iter, iter/n_iter*100, time_since(start), loss))

        if iter % plot_every == 0:
            losses.append(cur_loss/plot_every)
            cur_loss = 0

        now_epoch += batch_size

just in case, this is how i make batch
def make_batch(docs):
    target = []
    now_word = 0
    flag = True

    while flag:
        flag = False
        one_hot_vector = torch.zeros(seq_len, batch_size, input_size)
        for i, doc in enumerate(docs):
            for j in range(0, seq_len):
                try:
                    word = doc[now_word + j]
                    one_hot_vector[j][i][word_to_idx[word]] = 1
                    flag = True
                except IndexError:
                    break
        target.append(one_hot_vector.to(device))
        now_word += seq_len

    return target

i really really thank you for your answer…
oh by the way, it is a text generator using gru model.