I don’t know what is going on inside normalize that causes the problem, because like I said when I just skipped the “normalize” function it return correct answer.
I mean if I replace these line of code
                data_batch_ = normalize(data_batch.clone().detach(), mean, std, chose_dataset)
                data_batch_ = torch.tensor(data_batch_, requires_grad=True, device=device)
               # **data_batch_ = data_batch*

with just this
data_batch_ = data_batch
it shows me some expected results. So I infer that something is off about this normalize function.