Skip to content

Instantly share code, notes, and snippets.

@Bennykillua
Created July 2, 2022 14:10
Show Gist options
  • Save Bennykillua/6871a007facfe34550bb2035ed242243 to your computer and use it in GitHub Desktop.
Save Bennykillua/6871a007facfe34550bb2035ed242243 to your computer and use it in GitHub Desktop.
pytorch Open Source
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