Skip to content

20 - Quiz

  • Your name:

  • Your VT email:


What happens when you run b = a in PyTorch with a tensor a?

  • A. A new independent copy of a is created
  • B. b shares the same memory as a
  • C. a is a shadowed variable
  • D. A runtime error occurs

Which statement about slicing is true?

  • A. Slicing always creates a new copy
  • B. Slicing deletes the original tensor
  • C. Slicing only works for 1D and 2D tensors
  • D. Slicing returns a view that shares memory

What is broadcasting in PyTorch?

  • A. Automatically expanding tensor dimensions for operations
  • B. Sending tensors over a network
  • C. Copying tensors into multiple variables
  • D. Converting tensors to lists

What does x[:, 1] select from a 2D tensor?

  • A. The first row
  • B. The second row
  • C. The first column
  • D. The second column