Understand the basic 6 functions in PyTorch

squeeze(), unsqueeze(), tensor[None],max(),argmax(), and view()

Pic from github
c = torch.randn(3)
print(c)
print(torch.max(c))
c = torch.randn(2, 3)
print(c)
print(torch.max(c))
print(torch.max(c,0))
print(torch.max(c,1))
d = torch.randn(3)
print(d)
print(torch.argmax(d))
d = torch.randn(2,3)
print(d)
print(torch.argmax(d))

passionate about data analysis and data science

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store