Top "Pytorch" questions

PyTorch is a deep learning framework that implements a dynamic computational graph, which allows you to change the way your neural network behaves on the fly and capable of performing backward automatic differentiation.

How to check if pytorch is using the GPU?

I would like to know if pytorch is using my GPU. It's possible to detect with nvidia-smi if there is …

python memory-management gpu nvidia pytorch
How to initialize weights in PyTorch?

How to initialize the weights and biases (for example, with He or Xavier initialization) in a network in PyTorch?

python neural-network deep-learning pytorch
How does the "view" method work in PyTorch?

I am confused about the method view() in the following code snippet. class Net(nn.Module): def __init__(self): super(…

python memory pytorch torch tensor
Best way to save a trained model in PyTorch?

I was looking for alternative ways to save a trained model in PyTorch. So far, I have found two alternatives. …

python serialization deep-learning pytorch tensor
PyTorch: How to get the shape of a Tensor as a list of int

In numpy, V.shape gives a tuple of ints of dimensions of V. In tensorflow V.get_shape().as_list() …

python pytorch tensor
Pytorch reshape tensor dimension

For example, I have 1D vector with dimension (5). I would like to reshape it into 2D matrix (1,5). Here is how …

python numpy deep-learning pytorch tensor
Pytorch tensor to numpy array

I have a pytorch Tensor of size torch.Size([4, 3, 966, 1296]) I want to convert it to numpy array using the following …

python numpy pytorch
Model summary in pytorch

Is there any way, I can print the summary of a model in PyTorch like model.summary() method does in …

python pytorch
How to do product of matrices in PyTorch

In numpy I can do a simple matrix multiplication like this: a = numpy.arange(2*3).reshape(3,2) b = numpy.arange(2).reshape(2,1) print(…

python matrix pytorch
How to install pytorch in Anaconda with conda or pip?

I am trying to install pytorch in Anaconda to work with Python 3.5 in Windows. Following the instructions in pytorch.org …

python pip pytorch