Skip to content
← All tracks

Devices and Data Movement

PyTorch

Device-agnostic code, and the discipline of moving data once. Graded by counting the copies your code causes rather than by owning a GPU, so the lesson holds on the machine you have.

0 / 4 solved
  1. 1. Not solved yet. How many copies did that cost
  2. 2. Not solved yet. Where does a new tensor go
  3. 3. Not solved yet. The metric that stops the pipeline
  4. 4. Not solved yet. The constant that stayed behind

Check yourself

4 questions · one attempt each

These do not count toward finishing the track. They are here to catch the things that are easy to read past.

0 / 4

Which of torch.tensor(a) and torch.as_tensor(a) shares memory with the NumPy array?

a = np.ones(3)
torch.tensor(a)
torch.as_tensor(a)
Question 1 of 4