What is PyTorch?
A deep learning library developed by Facebook AI
What is the primary function of a CPU?
Handling general-purpose tasks
What is a tensor in PyTorch?
A multi-dimensional array used for computations
What does torch.max(x) do?
Finds the maximum value in x
How do you install PyTorch?
pip install torch torchvision torchaudio
Why is PyTorch widely used?
It has strong GPU support and is flexible
Why are GPUs preferred for deep learning?
They have thousands of cores for parallel processing
What makes tensors efficient for deep learning?
They can be processed on GPUs
How do you create a tensor from a list?
torch.tensor([1, 2, 3])
Who developed PyTorch?
Facebook AI
How many cores does a typical CPU have?
A few (2–16)
How do you specify a tensor’s data type?)
torch.tensor([1.0, 2.0, 3.0], dtype=torch.float32)
How do you transpose a tensor?
x.T or x.transpose(0,1)
How do you check if a GPU is available in PyTorch?
torch.cuda.is_available()
Which company manufactures GPUs for deep learning?
NVIDIA
What does torch.zeros(3,3) do?
Creates a 3×3 matrix filled with zeros
How do you compute the mean of a tensor?
torch.mean(x)
How do you check a tensor’s data type?
print(x.dtype)
What is the purpose of torch.view()?
To change the tensor’s shape
What does torch.split(x, 2) do?
Splits x into multiple tensors
Which function creates a random tensor?
torch.rand(2,2)
How do you convert a tensor to a NumPy array?
x.numpy()