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.

Pytorch preferred way to copy a tensor

There seems to be several ways to create a copy of a tensor in Pytorch, including y = tensor.new_tensor(…

copy pytorch tensor
PyTorch memory model: "torch.from_numpy()" vs "torch.Tensor()"

I'm trying to have an in-depth understanding of how PyTorch Tensor memory model works. # input numpy array In [91]: arr = np.…

python numpy multidimensional-array deep-learning pytorch
How to cast a 1-d IntTensor to int in Pytorch

I get a 1-D IntTensor,but i want to convert it to a integer. I try it by this method: …

pytorch tensor
What's the difference between torch.stack() and torch.cat() functions?

OpenAI's REINFORCE and actor-critic example for reinforcement learning has the following code: REINFORCE: policy_loss = torch.cat(policy_loss).sum() …

python machine-learning deep-learning pytorch
pytorch, AttributeError: module 'torch' has no attribute 'Tensor'

I'm working with Python 3.5.1 on a computer having CentOS Linux 7.3.1611 (Core) operating system. I'm trying to use PyTorch and I'm …

python python-3.5 centos7 torch pytorch
How to clear Cuda memory in PyTorch

I am trying to get the output of a neural network which I have already trained. The input is an …

python pytorch
How to write a PyTorch sequential model?

So far, I wrote my MLP, RNN and CNN in Keras, but now PyTorch is gaining popularity inside deep learning …

python sequential pytorch
Pytorch: Convert FloatTensor into DoubleTensor

I have 2 numpy arrays, which I convert into tensors to use the TensorDataset object. import torch.utils.data as data_…

python torch pytorch
Understanding a simple LSTM pytorch

import torch,ipdb import torch.autograd as autograd import torch.nn as nn import torch.nn.functional as F import …

neural-network lstm pytorch rnn
PyTorch / Gensim - How to load pre-trained word embeddings

I want to load a pre-trained word2vec embedding with gensim into a PyTorch embedding layer. So my question is, …

python neural-network pytorch gensim embedding