PyTorch Fundamentals

Test your understanding of tensors,autograd,and model building.

1. What is the basic building block of data in PyTorch?
2. Which PyTorch function creates a tensor with values sampled from a standard normal distribution (mean=0, variance=1)?
3. Which method is used to enable gradient computation for a tensor?
4. What is the default data type of a tensor created with torch.tensor([1, 2, 3])?
5. By default, where are PyTorch tensors stored?
6. What does the torch.cat function do?
7. Which PyTorch module provides tools for building neural networks?
8. What is the shape of the tensor created by torch.rand(3, 4, 2)?
9. Which method prevents a tensor from tracking gradients?
10. What is the result of torch.ones(2, 2) * 3?
11. Which of the following are valid ways to create a tensor with ones in PyTorch?
12. Which operations are element-wise in PyTorch?
13. Which are components of a PyTorch training loop?
14. Which data types are supported by PyTorch tensors?
15. PyTorch's autograd automatically computes gradients for tensor operations.
16. Tensors must be on GPU to use autograd.
17. torch.Tensor is an alias for torch.FloatTensor.
18. What does 'Py' in PyTorch stand for?
19. Name the PyTorch module for optimization (abbrev.)
20. Output of torch.tensor([2, 3]) + torch.tensor([4, 5])?
Answered 0 of 0 — 0 correct