Useful Links
Computer Science
Artificial Intelligence
Deep Learning
PyTorch Library
1. Introduction to PyTorch
2. Tensors: The Foundation
3. Tensor Operations and Manipulation
4. Automatic Differentiation
5. Neural Network Construction
6. Data Handling and Processing
7. Model Training and Optimization
8. Model Persistence and Deployment
9. Advanced PyTorch Features
10. PyTorch Ecosystem Integration
Tensors: The Foundation
Understanding Tensors
Mathematical Definition
Relationship to Arrays and Matrices
Role in Deep Learning
Tensor vs NumPy Array Comparison
Tensor Creation
From Python Data Structures
From Lists
From Nested Lists
From Tuples
From NumPy Arrays
Direct Conversion
Shared Memory Considerations
Factory Functions
torch.tensor()
torch.Tensor()
torch.as_tensor()
torch.from_numpy()
Initialization with Specific Values
torch.zeros()
torch.ones()
torch.full()
torch.eye()
torch.empty()
Sequential and Range Creation
torch.arange()
torch.linspace()
torch.logspace()
Random Tensor Generation
torch.rand()
torch.randn()
torch.randint()
torch.randperm()
Tensor Duplication
torch.clone()
Shallow vs Deep Copying
Tensor Attributes and Properties
Data Type (dtype)
Available Data Types
Type Conversion
Default Types
Device Location
CPU vs GPU Placement
Device Specification
Shape and Dimensionality
Shape Property
Size Method
Number of Dimensions
Number of Elements
Memory Layout
Contiguous vs Non-contiguous
Strides and Storage
Gradient Tracking
requires_grad Attribute
Gradient Computation Context
Tensor Data Types
Floating Point Types
torch.float32
torch.float64
torch.float16
torch.bfloat16
Integer Types
torch.int8
torch.int16
torch.int32
torch.int64
torch.uint8
Boolean Type
torch.bool
Complex Types
torch.complex64
torch.complex128
Type Conversion and Casting
Explicit Type Conversion
Automatic Type Promotion
Device Management
CPU and GPU Devices
Device Specification
Default Device Behavior
Moving Tensors Between Devices
to() Method
cpu() Method
cuda() Method
Device-Specific Creation
Specifying Device at Creation
Device Context Managers
Multi-GPU Considerations
GPU Selection
Memory Management Across Devices
Previous
1. Introduction to PyTorch
Go to top
Next
3. Tensor Operations and Manipulation