#Learning objective
This chapter covers the basics of tensors in PyTorch. You’ll learn what tensors are, how to create them with various methods, and understand their different data types. We’ll also explore basic operations, how to get information from tensors, and manipulate their structure. Additionally, you'll discover how to run PyTorch on a GPU and test your knowledge with a quiz at the end.
Discover how to create tensors in PyTorch using various methods. We will explore:
2.1. Tensors of Different Dimensions
- Create 1D, 2D, and 3D tensors.
2.2. Random Tensors
- Create tensors with random values and understand their use.
2.3. Zeros and Ones
- Create tensors filled with zeros or ones and their applications.
2.4. Range and Shape-Matching Tensors
Create tensors with a range of values and tensors with shapes matching other tensors.