Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tutorials/01-basics/pytorch_basics/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@
# Convert the numpy array to a torch tensor.
y = torch.from_numpy(x)

# Convert the torch tensor to a numpy array.
# Convert the torch tensor back to a numpy array.
z = y.numpy()

# x and z have identical values inside
assert np.all(x == z)

# ================================================================== #
# 4. Input pipeline #
Expand Down