fix move model to device before calculating loss

This commit is contained in:
DrCesar 2024-05-14 22:28:00 -07:00
parent e4227c899b
commit d2410cb0c6

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()"