Pytorch Mcq

Pytorch Interview Questions (MCQ): Test Your Knowledge!

 

 

What method is used to compute the natural logarithm of (1 + x) for a tensor?
torch.log1p(tensor)
tensor.log1p()
torch.ln1p(tensor)
tensor.compute_log1p()
How can you use torch.nn.utils.prune.identity in PyTorch?
To identify pruning
For applying identity pruning (no pruning)
To optimize model structure
To implement custom pruning techniques
How does torch.distributed.launch work in PyTorch?
It launches distributed training on multiple GPUs
For launching PyTorch applications
To initiate model deployment
To start data preprocessing
What is curriculum learning in the context of deep learning?
Gradually increasing model complexity
Gradually increasing training data size
Gradually increasing learning rate
Gradually increasing difficulty of training examples
How can you implement learning rate scheduling in PyTorch?
Using classes from torch.optim.lr_scheduler
Learning rate scheduling is not supported in PyTorch
By manually changing the learning rate
By using a custom optimizer
What is the primary function of torch.cuda.is_available() in PyTorch?
To enable CUDA
To disable CUDA
To check CUDA availability
To optimize CUDA usage
Which of the following is NOT a valid pooling layer in PyTorch?
MeanPool2d
MaxPool2d
AvgPool2d
AdaptiveAvgPool2d
Which of the following is NOT a valid method to create a diagonal tensor in PyTorch?
torch.diagonal_matrix()
torch.diag()
torch.diagonal()
torch.eye()
Which PyTorch function is used to compute the cosine similarity between tensors?
torch.cosine()
F.cosine_similarity()
nn.CosineSimilarity()
Both b and c
Which PyTorch function is used to apply dropout to 2D inputs?
nn.Dropout()
nn.Dropout2d()
F.dropout2d()
Both b and c
What is the primary purpose of PyTorch?
Web development
Database management
Deep learning
Image editing
What is the purpose of torch.nn.AdaptiveAvgPool2d in PyTorch?
To adapt to different pool sizes
For adaptive average pooling operations
To optimize pooling layers
To create custom pooling functions
What is underfitting in PyTorch models?
When models inadequately learn and fail to capture the underlying data patterns
When models are too complex for the available data
When the batch size is too large
When the learning rate is too low
What is the purpose of torch.nn.utils.vector_to_parameters in PyTorch?
To vectorize parameters
To convert a vector to model parameters
To optimize parameter storage
To implement vector operations
What is PyTorch Geometric Temporal?
An extension of PyTorch Geometric for spatio-temporal graph data
A time series analysis library
A scheduling tool for PyTorch training
A temporal logic framework for PyTorch
How can you implement custom backward functions in PyTorch?
By subclassing torch.autograd.Function
Using the @backward decorator
Modifying the backward() method of nn.Module
PyTorch doesn't support custom backward functions
What is the purpose of torch.nn.functional.gelu in PyTorch?
To apply the GELU activation function
To implement Gaussian error linear units
To optimize Gaussian processes
To normalize inputs using Gaussian distribution
Which company originally developed PyTorch?
Facebook (Meta)
Google
Microsoft
Amazon
Which function concatenates tensors along a given dimension in PyTorch?
torch.concat
torch.cat
torch.join
torch.merge
What is the purpose of torch.hub in PyTorch?
To manage model versioning
To load pre-trained models
To create model hubs
To optimize model architecture
Score: 0/20