From 285a500bc2fb99290993892118f89629dfecfa62 Mon Sep 17 00:00:00 2001 From: Siva ganesh <119166009+mazarrazi@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:34:10 +0530 Subject: [PATCH 1/4] Update 00_pytorch_fundamentals.ipynb line 1524, "| **Matrix multiplication** | `[1*1 + 2*2 + 3*3]` = `[14]` | `tensor.matmul(tensor)` |\n" tensor.matmul(tensor) is replaced with torch.matmul(tensor) --- 00_pytorch_fundamentals.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/00_pytorch_fundamentals.ipynb b/00_pytorch_fundamentals.ipynb index 17c5d9ef..ebc4e0fc 100644 --- a/00_pytorch_fundamentals.ipynb +++ b/00_pytorch_fundamentals.ipynb @@ -1521,7 +1521,7 @@ "| Operation | Calculation | Code |\n", "| ----- | ----- | ----- |\n", "| **Element-wise multiplication** | `[1*1, 2*2, 3*3]` = `[1, 4, 9]` | `tensor * tensor` |\n", - "| **Matrix multiplication** | `[1*1 + 2*2 + 3*3]` = `[14]` | `tensor.matmul(tensor)` |\n" + "| **Matrix multiplication** | `[1*1 + 2*2 + 3*3]` = `[14]` | `torch.matmul(tensor)` |\n" ] }, { From e94b347bfcc19a556da37dbed87205862bacec2b Mon Sep 17 00:00:00 2001 From: Siva ganesh <119166009+mazarrazi@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:04:34 +0530 Subject: [PATCH 2/4] removed a deprecated method and corrected it accordingly The torch.Tensor.type() method is deprecated. It was used to change the data type of a tensor. However, this method is no longer recommended because it can lead to unexpected results. Changed the code snippet from using torch.Tensor.type(dtype=None) to tensor = tensor.to(torch.float32) for changing the datatype of tensors. @ line 2189 under the "Change tensor datatype" heading The link to the documentation has been updated accordingly. --- 00_pytorch_fundamentals.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/00_pytorch_fundamentals.ipynb b/00_pytorch_fundamentals.ipynb index ebc4e0fc..6e66f838 100644 --- a/00_pytorch_fundamentals.ipynb +++ b/00_pytorch_fundamentals.ipynb @@ -2186,7 +2186,7 @@ "\n", "But there's a fix.\n", "\n", - "You can change the datatypes of tensors using [`torch.Tensor.type(dtype=None)`](https://pytorch.org/docs/stable/generated/torch.Tensor.type.html) where the `dtype` parameter is the datatype you'd like to use.\n", + "You can change the datatypes of tensors using [tensor = tensor.to(torch.float32)](https://pytorch.org/docs/stable/generated/torch.Tensor.to.html#torch.Tensor.to) where the torch.float32 is the datatype you'd like to use.\n", "\n", "First we'll create a tensor and check it's datatype (the default is `torch.float32`)." ] From a3096386da9686d6ce6015bc6d4fb01fa945da76 Mon Sep 17 00:00:00 2001 From: Siva ganesh <119166009+mazarrazi@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:07:39 +0530 Subject: [PATCH 3/4] removed a deprecated method and corrected it accordingly The torch.Tensor.type() method is deprecated. It was used to change the data type of a tensor. However, this method is no longer recommended because it can lead to unexpected results. Changed the code snippet from using `torch.Tensor.type(dtype=None)` to `tensor = tensor.to(torch.float32)` for changing the datatype of tensors. @ line 2189 under the "Change tensor datatype" heading The link to the documentation has been updated accordingly. --- 00_pytorch_fundamentals.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/00_pytorch_fundamentals.ipynb b/00_pytorch_fundamentals.ipynb index 6e66f838..449a4e43 100644 --- a/00_pytorch_fundamentals.ipynb +++ b/00_pytorch_fundamentals.ipynb @@ -2186,7 +2186,7 @@ "\n", "But there's a fix.\n", "\n", - "You can change the datatypes of tensors using [tensor = tensor.to(torch.float32)](https://pytorch.org/docs/stable/generated/torch.Tensor.to.html#torch.Tensor.to) where the torch.float32 is the datatype you'd like to use.\n", + "You can change the datatypes of tensors using [`tensor = tensor.to(torch.float32)`](https://pytorch.org/docs/stable/generated/torch.Tensor.to.html#torch.Tensor.to) where the torch.float32 is the datatype you'd like to use.\n", "\n", "First we'll create a tensor and check it's datatype (the default is `torch.float32`)." ] From 0b83446f3f861c14456f527d7d6b58c87830c3e0 Mon Sep 17 00:00:00 2001 From: Siva ganesh <119166009+mazarrazi@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:14:13 +0530 Subject: [PATCH 4/4] removed a deprecated method The torch.Tensor.type() method is deprecated. It was used to change the data type of a tensor. However, this method is no longer recommended because it can lead to unexpected results. Removed the code snippet `torch.Tensor.type(dtype=None)` @ line 2189 --- 00_pytorch_fundamentals.ipynb | 2 -- 1 file changed, 2 deletions(-) diff --git a/00_pytorch_fundamentals.ipynb b/00_pytorch_fundamentals.ipynb index 449a4e43..967fc896 100644 --- a/00_pytorch_fundamentals.ipynb +++ b/00_pytorch_fundamentals.ipynb @@ -2186,8 +2186,6 @@ "\n", "But there's a fix.\n", "\n", - "You can change the datatypes of tensors using [`tensor = tensor.to(torch.float32)`](https://pytorch.org/docs/stable/generated/torch.Tensor.to.html#torch.Tensor.to) where the torch.float32 is the datatype you'd like to use.\n", - "\n", "First we'll create a tensor and check it's datatype (the default is `torch.float32`)." ] },