@InnovArul Thank you for your reply,
I just change torch.tensor() to torch.Tensor(), I am training a regression model and no matter what architecture I used, after a short time of training, all the output will tend to be similar. (at first, I think it is the batch norm problem)
Then I decided to create a new project and code again, this time when I use torch.Tensor(my_target), I got something like this
>>> torch.Tensor(10)
tensor([2.8958e+32, 3.4970e-38, 1.0141e+31, 1.1210e-44, 9.9920e-38, 1.9793e-18,
4.5036e+16, 4.0556e-08, 2.5038e-12, 4.0058e-11])
Which is normal in case torch.tensor()
>>> torch.tensor(10)
tensor(10)
Therefore, I decided to come back to my old repository and change tensor to Tensor and the miracle happened.
For additional information, I am using pytorch 1.7.0