All PyTorch quizzes
Beginner31 questions45 minutes

PyTorch Beginner Quiz

Master PyTorch basics including tensors, operations, autograd, and neural network basics

Start the quiz

Sample questions from this quiz

A preview of the style and depth. Try each one, then reveal the answer — or skip straight to the timed quiz.

1. What is PyTorch?

  • A Python library
  • A data analysis tool
  • Open-source machine learning framework developed by Facebook
  • A web framework
Show answer

Answer: Open-source machine learning framework developed by Facebook. PyTorch is an open-source machine learning framework developed by Facebook AI Research. It provides tensor computation and deep learning capabilities.

2. What is a tensor in PyTorch?

  • A matrix
  • A vector
  • A scalar
  • Multi-dimensional array similar to NumPy ndarray
Show answer

Answer: Multi-dimensional array similar to NumPy ndarray. A tensor is a multi-dimensional array, similar to NumPy ndarray but can run on GPUs. It is the fundamental data structure in PyTorch.

3. How do you create a tensor from a Python list?

  • torch.from_list([1, 2, 3])
  • torch.array([1, 2, 3])
  • torch.tensor([1, 2, 3])
  • tensor.create([1, 2, 3])
Show answer

Answer: torch.tensor([1, 2, 3]). Use torch.tensor([1, 2, 3]) to create a tensor from a Python list. torch.Tensor() is also available but torch.tensor() is preferred.

Frequently asked questions

How many questions are in this PyTorch quiz?+

31 questions, with a 45-minute time limit. Every question includes a written explanation of the correct answer.

Is this PyTorch quiz free?+

Yes. Every quiz on CodexQuizz is free and needs no account. You only enter a name if you choose to post your score to the leaderboard.

What level is the beginner quiz aimed at?+

Master PyTorch basics including tensors, operations, autograd, and neural network basics

Can I use this to prepare for a PyTorch interview?+

Yes. The questions cover the topics that come up in PyTorch technical screens, and the explanations are written so that a wrong answer still teaches you the underlying concept.

Ready to test your PyTorch?

31 questions, 45 minutes. Free, no sign-up.

Start now