Merge pull request #157 from DrCesar/main

fix move model to device before calculating loss
This commit is contained in:
Sebastian Raschka 2024-05-15 20:58:43 -04:00 committed by GitHub
commit 738ec44bf9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -425,6 +425,7 @@
"\n",
"torch.manual_seed(123)\n",
"model = GPTModel(GPT_CONFIG_124M)\n",
"model.to(device)\n",
"\n",
"loss = calc_loss_batch(input_batch, target_batch, model, device)\n",
"loss.backward()"