LESSON 0.6 · Lab · 120 min

PyTorch tensors and reproducible experiments

PyTorch tensors and reproducible experiments. Learn dtype, device, strides, autograd, and random seeds and complete: Build a reproducible tensor-lab repository. Part of the “Before

Learning objectives

  1. Explain what problem “PyTorch tensors and reproducible experiments” solves without hiding behind terminology.
  2. Trace the variables and causal links across dtype, device, strides.
  3. Complete “Build a reproducible tensor-lab repository” and judge the result with evidence rather than intuition.

Core concepts

dtype

dtype is part of the lesson’s causal model. State its inputs, outputs, invariants, and failure mode; then verify it with a hand-check or a minimal experiment before moving to an optimized implementation.

device

device is part of the lesson’s causal model. State its inputs, outputs, invariants, and failure mode; then verify it with a hand-check or a minimal experiment.

strides

strides is part of the lesson’s causal model. State its inputs, outputs, invariants, and failure mode; then verify it with a hand-check or a minimal experiment.

autograd

autograd is part of the lesson’s causal model. State its inputs, outputs, invariants, and failure mode; then verify it with a hand-check or a minimal experiment.

and random seeds

and random seeds is part of the lesson’s causal model. State its inputs, outputs, invariants, and failure mode; then verify it with a hand-check or a minimal experiment.

Build and verify

Build a reproducible tensor-lab repository

  • Predict: write the expected output, trend, or failure before running code.
  • Build: implement only the minimum components needed to answer the question.
  • Verify: compare with a baseline or trusted implementation; save seeds, parameters, and raw outputs.
  • Transfer: change one shape, dataset, scale, or workload condition and explain whether the conclusion still holds.

Open the complete interactive lesson