From 90673f9b7d04d94f730dd617a999a2154ea2ccb7 Mon Sep 17 00:00:00 2001 From: Nishant Garg Date: Mon, 5 Jan 2026 16:05:27 -0500 Subject: [PATCH 1/2] Fix output variable in printf Fix output variable in printf in the "Defining a neural network using the PyTorch Sequential API" section --- lab1/PT_Part1_Intro.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lab1/PT_Part1_Intro.ipynb b/lab1/PT_Part1_Intro.ipynb index 49bcdeee..89f45d8f 100644 --- a/lab1/PT_Part1_Intro.ipynb +++ b/lab1/PT_Part1_Intro.ipynb @@ -425,8 +425,8 @@ "x_input = torch.tensor([[1, 2.]])\n", "model_output = model(x_input)\n", "print(f\"input shape: {x_input.shape}\")\n", - "print(f\"output shape: {y.shape}\")\n", - "print(f\"output result: {y}\")" + "print(f\"output shape: {model_output.shape}\")\n", + "print(f\"output result: {model_output}\")" ] }, { From 055b969eead6d0fe7241e17762aaf927e1f0bf09 Mon Sep 17 00:00:00 2001 From: Nishant Garg Date: Mon, 5 Jan 2026 16:19:19 -0500 Subject: [PATCH 2/2] Add assertion to [Test the IdentityModel] Section --- lab1/PT_Part1_Intro.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lab1/PT_Part1_Intro.ipynb b/lab1/PT_Part1_Intro.ipynb index 89f45d8f..575f5a21 100644 --- a/lab1/PT_Part1_Intro.ipynb +++ b/lab1/PT_Part1_Intro.ipynb @@ -547,7 +547,9 @@ "out_with_identity = # TODO\n", "\n", "print(f\"input: {x_input}\")\n", - "print(\"Network linear output: {}; network identity output: {}\".format(out_with_linear, out_with_identity))" + "print(\"Network linear output: {}; network identity output: {}\".format(out_with_linear, out_with_identity))", + "\n" + "assert torch.equal(x_input, out_with_identity)" ] }, {