From d3d7a3feb7e1cd8f7617fe43d91b1e75d92cf431 Mon Sep 17 00:00:00 2001 From: wizardforcel <562826179@qq.com> Date: Fri, 15 Jan 2021 23:40:54 +0800 Subject: [PATCH] 2021-01-15 23:40:54 --- new/dl-pt-workshop/1.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/new/dl-pt-workshop/1.md b/new/dl-pt-workshop/1.md index 8f1cbb43..6d5735dc 100644 --- a/new/dl-pt-workshop/1.md +++ b/new/dl-pt-workshop/1.md @@ -181,7 +181,7 @@ example_2 = torch.randint(low=0, high=2, \ tensor_1 = torch.tensor([0.1,1,0.9,0.7,0.3]) tensor_2 = torch.tensor([[0,0.2,0.4,0.6],[1,0.8,0.6,0.4]]) tensor_3 = torch.tensor([[[0.3,0.6],[1,0]], \ -                          [[0.3,0.6],[0,1]]]) + [[0.3,0.6],[0,1]]]) ``` 如果您的计算机具有可用的 GPU,则可以使用 GPU 语法创建等效张量: @@ -189,9 +189,9 @@ example_2 = torch.randint(low=0, high=2, \ ```py tensor_1 = torch.tensor([0.1,1,0.9,0.7,0.3]).cuda() tensor_2 = torch.tensor([[0,0.2,0.4,0.6], \ -                        [1,0.8,0.6,0.4]]).cuda() + [1,0.8,0.6,0.4]]).cuda() tensor_3 = torch.tensor([[[0.3,0.6],[1,0]], \ -                         [[0.3,0.6],[0,1]]]).cuda() + [[0.3,0.6],[0,1]]]).cuda() ``` 3. Print the shape of each of the tensors using the **shape** property, just as you would do with NumPy arrays: -- GitLab