[C1W4A_Build_a_Conditional_GAN # UNQ_C2] Model didn't learn with the wrong float casting in combine_vectors

Hi!, I encountered the problem with model-not-learning with
torch.cat((torch.tensor(x, dtype=torch.float32), torch.tensor(y, dtype=torch.float32)), 1)
in combine_vectors method
// Although it passes all the unit tests
But it works well with “torch.cat((x.float(), y.float()), dim = 1)”
Can somebody explain the difference"?

The tensor result is the same for the torch.tensor(x, dtype=torch.float32) and x.float()


I supsect it has to do with the version of PyTorch it is being used

Do you mean, a PyTorch version?


1 Like

Yes, this is a known case in which the grader seems to use an older version of PyTorch. Here’s another thread about it.