1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Deep Learning with PyTorch

Connected

Exercise

Using TensorDataset

Structuring your data into a dataset is one of the first steps in training a PyTorch neural network. TensorDataset simplifies this by converting NumPy arrays into a format PyTorch can use.

In this exercise, you'll create a TensorDataset using the preloaded animals dataset and inspect its structure.

Instructions

100 XP
  • Convert X and y into tensors and create a TensorDataset.
  • Access and print the first sample.