From adf63654384696a74045dde6a1dd6ca822e26d16 Mon Sep 17 00:00:00 2001 From: Ayo Date: Tue, 2 Sep 2025 22:51:50 +0200 Subject: [PATCH] update tensors.py --- 01-tensors.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/01-tensors.py b/01-tensors.py index 0fef88d..4e00081 100644 --- a/01-tensors.py +++ b/01-tensors.py @@ -34,9 +34,9 @@ print(f"Zeros: \n {zeros_tensor} \n") tensor_attr = torch.rand(3,4).to('xpu') -# print(f"Shape: {tensor_attr.shape}") -# print(f"Datatype: {tensor_attr.dtype}") -# print(f"Device: {tensor_attr.device}") +print(f"Shape: {tensor_attr.shape}") +print(f"Datatype: {tensor_attr.dtype}") +print(f"Device: {tensor_attr.device}") # indexing & slicing @@ -60,7 +60,7 @@ y3 = torch.rand_like(y1) # create a new tensor with same shape as y1 torch.matmul(tensor, tensor.T, out=y3) -# comput the element-wise product (z1, z2, z3 will have same values) +# compute the element-wise product (z1, z2, z3 will have same values) z1 = tensor * tensor z2 = tensor.mul(tensor)