Skip to content
← Learn PyTorch

Orientation and the Grade

PyTorch

Get started with PyTorch exercises. Learn to read the requirements, interpret test failures, and recognize checks for behavior beyond numerical output.

3 exercises

Explore freely. Sign in to keep your progress.

Your learning sequence

  1. 1 Not solved yet. Count the tensor operations Practice · Easy
  2. 2 Not solved yet. Transpose a tensor while sharing its storage Practice · Easy
  3. 3 Not solved yet. Subtract each row's mean with correct broadcasting Practice · Easy

Check yourself

4 questions · not saved while you're signed out

Use these questions to check your understanding and compare explanations. Your score does not affect track completion.

0 / 4 correct

What shape does this scalar tensor have, and what kind of value does item() return?

Choose one answer to reveal the explanations. Answers are kept only while this page is open.

import torch

t = torch.tensor(3.0)
print(t.shape)
value = t.item()
print(value, type(value).__name__)
print(torch.tensor([3.0]).shape)
Question 1 of 4