ArrayLab Explore arrays. Understand tensors.
a = shape (2, 3)
Try

Spaces or commas between values · new line = new row · blank line = new 2-D layer (3-D array).

Run the PyTorch side in Colab

NumPy runs here for real; PyTorch does not run in the browser. PyTorch code is shown next to it, and every PyTorch result stated here (dtypes, errors) was recorded with PyTorch 2.14.0.

Starting Python… (first visit downloads ≈ 15 MB, then it is cached)
a NumPy ndarray · runs here
t — the same numbers as a PyTorch Tensor not run here
import torch

t = torch.tensor([[1, 2, 3],
                  [4, 5, 6]])

Same values, same shape, same axes: a tensor is PyTorch’s n-dimensional array.

Python not started
import numpy as np

a = np.array([[1, 2, 3],
              [4, 5, 6]])

a
Output

Output appears here.