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 create a normal distribution in pytorch

I want to create a random normal distribution in pytorch and mean and std are 4, 0.5 respectively. I didn't find a …

python statistics pytorch linear-algebra normal-distribution
CUDA runtime error (59) : device-side assert triggered

I have access to Tesla K20c, I am running ResNet50 on CIFAR10 dataset... Then I get the error as: …

gpu pytorch
How to get a uniform distribution in a range [r1,r2] in PyTorch?

The question says it all. I want to get a 2-D torch.Tensor with size [a,b] filled with values …

pytorch uniform-distribution
RuntimeError: Expected object of type torch.DoubleTensor but found type torch.FloatTensor for argument #2 'weight'

My input tensor is torch.DoubleTensor type. But I got the RuntimeError below: RuntimeError: Expected object of type torch.DoubleTensor …

pytorch
Why do we call .detach() before calling .numpy() on a Pytorch Tensor?

It has been firmly established that my_tensor.detach().numpy() is the correct way to get a numpy array from …

numpy pytorch autodiff
How to Display Custom Images in Tensorboard (e.g. Matplotlib Plots)?

The Image Dashboard section of the Tensorboard ReadMe says: Since the image dashboard supports arbitrary pngs, you can use this …

python tensorflow matplotlib pytorch tensorboard
RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same

I am trying to train the following CNN as follows, but I keep getting the same error regarding .cuda() and …

python python-3.x machine-learning deep-learning pytorch
How do I get value of a tensor in PyTorch?

x = torch.tensor([3]) I have a tensor object when I print(x) it gives tensor([3]) x.data[0] gives tensor(3) How …

python pytorch tensor
why do we "pack" the sequences in pytorch?

I was trying to replicate How to use packing for variable-length sequence inputs for rnn but I guess I first …

deep-learning pytorch recurrent-neural-network tensor zero-padding
How do I visualize a net in Pytorch?

import torch import torch.nn as nn import torch.optim as optim import torch.utils.data as data import torchvision.…

python pytorch