From c2fc05e0638cf30c29d6848146056895960d0737 Mon Sep 17 00:00:00 2001 From: Matus-Dubrava <40363398+Matus-Dubrava@users.noreply.github.com> Date: Sun, 29 Nov 2020 15:06:13 +0100 Subject: [PATCH] fixed incorrect method call - torch.stack should be torch.cat, and fixed incorrect variable name (#338) Co-authored-by: Matus --- 12_nlp_dive.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/12_nlp_dive.ipynb b/12_nlp_dive.ipynb index 8ebfd2b..8b68303 100644 --- a/12_nlp_dive.ipynb +++ b/12_nlp_dive.ipynb @@ -1614,14 +1614,14 @@ "\n", " def forward(self, input, state):\n", " h,c = state\n", - " h = torch.stack([h, input], dim=1)\n", + " h = torch.cat([h, input], dim=1)\n", " forget = torch.sigmoid(self.forget_gate(h))\n", " c = c * forget\n", " inp = torch.sigmoid(self.input_gate(h))\n", " cell = torch.tanh(self.cell_gate(h))\n", " c = c + inp * cell\n", " out = torch.sigmoid(self.output_gate(h))\n", - " h = outgate * torch.tanh(c)\n", + " h = out * torch.tanh(c)\n", " return h, (h,c)" ] }, @@ -2362,4 +2362,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +}