Created
July 2, 2022 14:10
-
-
Save Bennykillua/6871a007facfe34550bb2035ed242243 to your computer and use it in GitHub Desktop.
pytorch Open Source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
p_Tensor = torch.ones((2, 2)) | |
#size of a Tensor | |
print(p_Tensor.size()) | |
#resizing 2x2 Tensor to 4x1 | |
p_Tensor = p_Tensor.view(4) | |
print(p_Tensor) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment