Cheat Sheet Deep learning_PyTorch
Table of contents
No headings in the article.
torch.matmul(a, b) # multiples torch tensors a and b
* # element-wise multiplication between two torch tensorstorch.eye(n) # creates an identity torch tensor with shape (n, n)
torch.zeros(n, m) # creates a torch tensor of zeros with shape (n, m)
torch.ones(n, m) # creates a torch tensor of ones with shape (n, m)
torch.rand(n, m) # creates a random torch tensor with shape (n, m)
torch.tensor(l) # creates a torch tensor based on list l