Oh I see.
My training method and loop is attached below
def train(tracker_model, tracker_opt, epoch, _):
    global train_tracker
    if train_tracker:
        global tracker_inputs

        tracker_in = torch.as_tensor(np.concatenate([np.real(tracker_inputs)[:, None, None],
                                                     np.imag(tracker_inputs)[:, None, None]], axis=2))
        for i in range(epoch):
            tracker_model.train()
            tracker_opt.zero_grad()
            tracker_out = tracker_model(tracker_in.float())
            loss = nn.MSELoss()
            temp = generate_ar_sequence(16)
            loss_tracker = loss(tracker_out, torch.as_tensor(np.concatenate([np.real(temp)[:, None],
                                                                             np.imag(temp)[:, None]], axis=1)).float())
            loss_tracker.backward(retain_graph=True)
            tracker_opt.step()
            tracker_in = tracker_out[:, None, :]
        train_tracker = False
        tracker_model.eval()