CARVIEW |
Pytorch
Pytorch
Question 1
Which method is used to reshape a tensor in PyTorch?
reshape()
view()
resize()
flatten()
Question 2
Which function is used to generate a tensor with random values in PyTorch?
torch.zeros()
torch.ones()
torch.rand()
torch.tensor()
Question 3
Which method transfers a tensor to the GPU in PyTorch?
tensor.cuda()
tensor.device()
tensor.gpu()
tensor.to()
Question 4
Which PyTorch module is used for defining loss functions?
torch.nn.functional
torch.autograd
torch.optim
torch.tensor
Question 5
How can you create a tensor with all elements set to 1 in PyTorch?
torch.rand()
torch.full()
torch.ones()
torch.zeros()
Question 6
Which method is used to return the number of dimensions of a tensor?
size()
shape
dim()
length()
Question 7
Which function is used to concatenate two tensors along a specific dimension?
torch.cat()
torch.concat()
torch.join()
torch.merge()
There are 7 questions to complete.